From d13bd3253888e62feae0f2bd73e96d2fd4480b88 Mon Sep 17 00:00:00 2001 From: liangyuyan <1103300295@qq.com> Date: Wed, 12 Aug 2020 12:04:32 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E6=83=A0=E5=88=B8=E8=BF=94=E5=88=B8?= =?UTF-8?q?=E6=B4=BB=E5=8A=A8--=E5=8F=AA=E6=9C=89=E5=8A=A0=E8=BF=9B?= =?UTF-8?q?=E6=B4=BB=E5=8A=A8=E7=9A=84=E5=88=B8=E6=89=8D=E8=BF=94=E5=9B=9E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Service/CouponService.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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; }