diff --git a/app/Service/CouponService.php b/app/Service/CouponService.php index 994b899..6105ea5 100644 --- a/app/Service/CouponService.php +++ b/app/Service/CouponService.php @@ -72,7 +72,7 @@ class CouponService implements CouponServiceInterface // 转发型优惠券 $couponReceiveIds = $couponActivity === false ? [] : explode(',',$couponActivity['forward']); - + $whereC = [ ['u.end_time','>',$nowTime], ['u.start_time','<=',$nowTime], @@ -85,7 +85,7 @@ class CouponService implements CouponServiceInterface $coupons = Db::table('ims_system_coupon_user as u') ->join('ims_system_coupon_user_receivetype as type', 'u.id', '=', 'type.system_coupon_user_id') - ->whereIn('u.id', $couponIds) + ->whereIn('u.id', $couponReceiveIds) ->where($whereC) ->whereRaw('u.inventory_use < u.inventory and u.inventory-u.inventory_use >= type.one_receive_number') ->select('u.*','type.one_receive_number')