修改优化查询

This commit is contained in:
liu 2024-03-09 18:31:13 +08:00
parent a007894fa6
commit d614cfc42a

View File

@ -193,8 +193,10 @@ class UserBillDao extends BaseDao
->when(isset($where['now_money']) && in_array($where['now_money'], [0, 1, 2]), function ($query) use ($where) {
if ($where['now_money'] == 0) //->whereIn('category', ['now_money','brokerage'])
$query->whereIn('type', ['pay_product', 'recharge', 'sys_inc_money', 'sys_dec_money', 'brokerage', 'presell', 'refund', 'zhibo_reward_inc', 'zhibo_reward_dec','order_one'])
->whereor('category','now_money')
->whereor('category','brokerage')
->where(function ($query) {
$query->where('category', 'now_money')
->orWhere('category', 'brokerage');
})
;
else if ($where['now_money'] == 1)
$query->where('category', 'now_money')->whereIn('type', ['pay_product', 'sys_dec_money', 'presell', 'zhibo_reward_dec']);