|
|
|
@ -141,12 +141,16 @@ class CouponController extends BaseController |
|
|
|
//$cps = Coupon::whereIn('id', $ids)->sharedLock()->get();
|
|
|
|
|
|
|
|
foreach ($cps as $key => $cp) { |
|
|
|
$crt = CouponUserRecType::where( |
|
|
|
[ |
|
|
|
|
|
|
|
$where = [ |
|
|
|
'system_coupon_user_id' => $cp->id, |
|
|
|
'receive_type' => $receiveType |
|
|
|
] |
|
|
|
)->first(); |
|
|
|
]; |
|
|
|
|
|
|
|
if (env('SUB_CHANNEL') == 1) { |
|
|
|
$where['receive_type'] = $receiveType; |
|
|
|
} |
|
|
|
|
|
|
|
$crt = CouponUserRecType::where($where)->first(); |
|
|
|
|
|
|
|
$cr = new CouponRec; |
|
|
|
$cr->user_id = $userId; |
|
|
|
|