|
|
|
@ -32,12 +32,26 @@ class CouponController extends BaseController |
|
|
|
|
|
|
|
$c_ids = CouponUserRecType::where('receive_type', $receive_type)->pluck('system_coupon_user_id'); |
|
|
|
$nowTime = time(); |
|
|
|
$cr_ids = CouponRec::where('user_id',$user_id)->pluck('system_coupon_user_id'); |
|
|
|
$cr_ids = CouponRec::where([ |
|
|
|
['user_id'=>$user_id], |
|
|
|
['receive_type'=>$receive_type] |
|
|
|
] |
|
|
|
)->pluck('system_coupon_user_id'); |
|
|
|
|
|
|
|
// $ids = array_merge($c_ids->toArray(), $cr_ids->toArray());
|
|
|
|
//
|
|
|
|
// //领过券的ID
|
|
|
|
// $ids = collect($ids)->unique();
|
|
|
|
$c_ids = $c_ids->toArray(); |
|
|
|
$cr_ids = $cr_ids->toArray(); |
|
|
|
$ids = []; |
|
|
|
foreach ($c_ids as $key => $val){ |
|
|
|
if(!in_array($val,$cr_ids)) { |
|
|
|
$ids[] = $val; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
$ids = array_merge($c_ids->toArray(), $cr_ids->toArray()); |
|
|
|
|
|
|
|
//领过券的ID
|
|
|
|
$ids = collect($ids)->unique(); |
|
|
|
|
|
|
|
$c = Db::table('ims_system_coupon_user as u') |
|
|
|
->where([ |
|
|
|
|