Browse Source

Merge branch 'develop' of ssh://120.24.33.109:11022/hyzjshwo/lanzu_api_hyperf into develop

master
weigang 5 years ago
parent
commit
f84559af40
  1. 6
      app/Controller/CouponController.php

6
app/Controller/CouponController.php

@ -32,9 +32,7 @@ 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)->pluck('system_coupon_user_id');
$ids = array_merge($c_ids->toArray(), $cr_ids->toArray());
@ -49,7 +47,7 @@ class CouponController extends BaseController
['u.status','=',1],
])
->join('ims_system_coupon_user_receivetype as type', 'u.id', '=', 'type.system_coupon_user_id')
->whereRaw('inventory_use <= inventory')
->whereRaw('u.inventory_use <= u.inventory and u.inventory-u.inventory_use > type.one_receive_number')
->whereIn('u.id',$ids)
->select('u.*','type.one_receive_number')
->orderBy('u.weigh','desc')

Loading…
Cancel
Save