Browse Source

失效优惠券

master
parent
commit
eeb804d427
  1. 7
      app/Controller/CouponController.php

7
app/Controller/CouponController.php

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

Loading…
Cancel
Save