|
|
|
@ -36,15 +36,17 @@ class CouponController extends BaseController |
|
|
|
|
|
|
|
$ids = collect($ids)->unique(); |
|
|
|
|
|
|
|
$c = Db::table('ims_system_coupon_user_receive as receive') |
|
|
|
$c = Db::table('ims_system_coupon_user as u') |
|
|
|
->where([ |
|
|
|
['end_time','>',$nowTime], |
|
|
|
['status','=',1], |
|
|
|
['u.end_time','>',$nowTime], |
|
|
|
['u.start_time','<=',$nowTime], |
|
|
|
['u.status','=',1], |
|
|
|
]) |
|
|
|
->join('ims_system_coupon_user as u', 'u.id', '=', 'receive.system_coupon_user_id') |
|
|
|
->join('ims_system_coupon_user_receivetype as type', 'u.id', '=', 'type.system_coupon_user_id') |
|
|
|
->whereRaw('inventory_use <= inventory') |
|
|
|
->whereIn('id',$ids) |
|
|
|
->orderBy('weigh','desc','id','desc') |
|
|
|
->whereIn('u.id',$ids) |
|
|
|
->select('u.*','type.one_receive_number') |
|
|
|
->orderBy('u.weigh','desc') |
|
|
|
->limit(4) |
|
|
|
->get(); |
|
|
|
return $this->success(['not_reveive'=>$c]); |
|
|
|
|