|
|
@@ -6,6 +6,7 @@ use app\common\model\coupon\CouponRules;
|
|
|
use app\common\model\coupon\UserCoupon;
|
|
|
use think\db\Query;
|
|
|
use think\db\Where;
|
|
|
+use think\Exception;
|
|
|
use think\facade\Db;
|
|
|
|
|
|
/**
|
|
|
@@ -33,6 +34,7 @@ class UserCouponLogic extends BaseLogic
|
|
|
}
|
|
|
if($v->remaining_count <= 0 ){
|
|
|
$errMsgArr[] = $v->event_name .'数量不足';
|
|
|
+ continue;
|
|
|
}
|
|
|
if($userCoupon->where('coupon_id',$v->id)->count()){
|
|
|
$errMsgArr[] = $v->event_name . '已领取';
|
|
|
@@ -56,7 +58,9 @@ class UserCouponLogic extends BaseLogic
|
|
|
'server_category_name' => $v->server_category_name
|
|
|
];
|
|
|
}
|
|
|
- CouponRules::updateWhenCase($updateData);
|
|
|
+ if(!empty($updateData)){
|
|
|
+ CouponRules::updateWhenCase($updateData);
|
|
|
+ }
|
|
|
if(!empty($createData)){
|
|
|
(new UserCoupon())->saveAll($createData);
|
|
|
}
|