优化查询
This commit is contained in:
parent
f8a4f0f71e
commit
a007894fa6
@ -191,8 +191,11 @@ class UserBillDao extends BaseDao
|
|||||||
{
|
{
|
||||||
return UserBill::getDB()
|
return UserBill::getDB()
|
||||||
->when(isset($where['now_money']) && in_array($where['now_money'], [0, 1, 2]), function ($query) use ($where) {
|
->when(isset($where['now_money']) && in_array($where['now_money'], [0, 1, 2]), function ($query) use ($where) {
|
||||||
if ($where['now_money'] == 0)
|
if ($where['now_money'] == 0) //->whereIn('category', ['now_money','brokerage'])
|
||||||
$query->whereIn('category', ['now_money','brokerage'])->whereIn('type', ['pay_product', 'recharge', 'sys_inc_money', 'sys_dec_money', 'brokerage', 'presell', 'refund', 'zhibo_reward_inc', 'zhibo_reward_dec','order_one']);
|
$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')
|
||||||
|
;
|
||||||
else if ($where['now_money'] == 1)
|
else if ($where['now_money'] == 1)
|
||||||
$query->where('category', 'now_money')->whereIn('type', ['pay_product', 'sys_dec_money', 'presell', 'zhibo_reward_dec']);
|
$query->where('category', 'now_money')->whereIn('type', ['pay_product', 'sys_dec_money', 'presell', 'zhibo_reward_dec']);
|
||||||
else if ($where['now_money'] == 2)
|
else if ($where['now_money'] == 2)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user