diff --git a/app/Service/CouponService.php b/app/Service/CouponService.php index b0aa716..994b899 100644 --- a/app/Service/CouponService.php +++ b/app/Service/CouponService.php @@ -70,8 +70,8 @@ class CouponService implements CouponServiceInterface // 当前用户可领的优惠券ID $couponIds = array_diff($c_ids, $cr_ids); - // 获取领取型优惠券 - $couponIds = $couponActivity['forward'] === false ? $couponIds : array_merge($couponIds,explode(',',$couponActivity['forward'])); + // 转发型优惠券 + $couponReceiveIds = $couponActivity === false ? [] : explode(',',$couponActivity['forward']); $whereC = [ ['u.end_time','>',$nowTime], @@ -97,7 +97,7 @@ class CouponService implements CouponServiceInterface if($v->active_type == 1){ $result['not_receive'][] = $v; - }else if($v->active_type == 2){ + }else if($v->active_type == 2 && in_array($v->id,$couponReceiveIds)){ $result['jump_data']['coupons'][] = $v->id; }