阶段性更新
This commit is contained in:
@@ -37,6 +37,9 @@ class Coupon extends Model
|
||||
case 4:
|
||||
return '已分润';
|
||||
break;
|
||||
case 5:
|
||||
return '已撤销';
|
||||
break;
|
||||
default:
|
||||
return '未知状态';
|
||||
break;
|
||||
@@ -88,6 +91,27 @@ class Coupon extends Model
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Notes: 撤销
|
||||
* @Author: 玄尘
|
||||
* @Date : 2020/10/12 13:56
|
||||
*/
|
||||
public function reversal()
|
||||
{
|
||||
$this->status = 5;
|
||||
$this->remark = '撤销成功';
|
||||
$this->save();
|
||||
|
||||
if ($this->profit > 0) {
|
||||
return $this->user->account->rule('refreeze', -$this->profit, false, [
|
||||
'coupon_id' => $this->id,
|
||||
'redemptionCode' => $this->redemptionCode,
|
||||
]);
|
||||
} else {
|
||||
return '不需要操作';
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Notes: 撤销分润
|
||||
* @Author: 玄尘
|
||||
|
||||
Reference in New Issue
Block a user