diff --git a/app/Controller/CouponController.php b/app/Controller/CouponController.php index 31e63a1..26296c6 100644 --- a/app/Controller/CouponController.php +++ b/app/Controller/CouponController.php @@ -141,12 +141,16 @@ class CouponController extends BaseController //$cps = Coupon::whereIn('id', $ids)->sharedLock()->get(); foreach ($cps as $key => $cp) { - $crt = CouponUserRecType::where( - [ - 'system_coupon_user_id' => $cp->id, - 'receive_type' => $receiveType - ] - )->first(); + + $where = [ + 'system_coupon_user_id' => $cp->id, + ]; + + if (env('SUB_CHANNEL') == 1) { + $where['receive_type'] = $receiveType; + } + + $crt = CouponUserRecType::where($where)->first(); $cr = new CouponRec; $cr->user_id = $userId;