Browse Source

领券校验

master
Lemon 5 years ago
parent
commit
f7c8dc2b4e
  1. 2
      app/Controller/v3/CouponController.php
  2. 6
      app/Service/v3/Implementations/CouponRecService.php

2
app/Controller/v3/CouponController.php

@ -103,7 +103,7 @@ class CouponController extends BaseController
return $this->success(
[
'status' => 'error',
'message' => '优惠券已经被抢光了',
'message' => '未满足领取条件',
'text'=>'关注懒族菜市微信公众号,更多精彩活动一手掌握!'
]
);

6
app/Service/v3/Implementations/CouponRecService.php

@ -443,6 +443,12 @@ class CouponRecService implements CouponRecServiceInterface
if($couponInventory < $oneReceiveNumber){
continue;
}
$couponReceiveExists = CouponRec::query()->where(['id'=>$cp->id,'user_id'=>$userId])->exists();
if($couponReceiveExists){
continue;
}
$cr = new CouponRec;
$cr->user_id = $userId;
$cr->coupon_id = $cp->id;

Loading…
Cancel
Save