This commit is contained in:
2021-02-22 16:22:28 +08:00
parent a99360186d
commit d2bf54ef9e
2 changed files with 2 additions and 2 deletions

View File

@@ -79,7 +79,7 @@ class Coupon extends Model
public function profit()
{
$log = AccountLog::where('source->coupon_id', $this->id)->first();
if (!$log && $this->user) {
if (!$log && $this->user && $this->profit) {
return $this->user->account->rule('freeze', $this->profit, false, [
'coupon_id' => $this->id,
'redemptionCode' => $this->redemptionCode,