阶段性更新

This commit is contained in:
2020-10-13 08:49:57 +08:00
parent 7cfd45bf99
commit d8cd8ae9a6
21 changed files with 420 additions and 423 deletions

View File

@@ -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: 玄尘