店长退款查询优化

pull/1/head
ztt 9 months ago
parent 99b4420459
commit 266f300a6d
  1. 13
      app/store/model/OrderRefund.php

@ -43,10 +43,14 @@ class OrderRefund extends OrderRefundModel
} }
$filterOr = []; $filterOr = [];
if (!empty($param['searchValue']) && $param['searchType'] == 'all') { if (!empty($param['searchValue']) && $param['searchType'] == 'all') {
// $filterOr = [
// ['order.order_no', 'like', "%{$param['searchValue']}%"],
// ['user.nick_name', 'like', "%{$param['searchValue']}%"],
// ['order.user_id', '=', (int)$param['searchValue']]
// ];
$filterOr = [ $filterOr = [
['order.order_no', 'like', "%{$param['searchValue']}%"], ['order.order_no|user.nick_name|order.user_id', 'like', "%{$param['searchValue']}%"]
['user.nick_name', 'like', "%{$param['searchValue']}%"],
['order.user_id', '=', (int)$param['searchValue']]
]; ];
} }
@ -57,7 +61,8 @@ class OrderRefund extends OrderRefundModel
->join('user', 'user.user_id = order.user_id') ->join('user', 'user.user_id = order.user_id')
->where($filter); ->where($filter);
if(!empty($filterOr)){ if(!empty($filterOr)){
$query = $query->whereOr($filterOr); // $query = $query->whereOr($filterOr);
$query = $query->where($filterOr);
} }
$list = $query->order(['refund.create_time' => 'desc', 'refund.' . $this->getPk()]) $list = $query->order(['refund.create_time' => 'desc', 'refund.' . $this->getPk()])
->paginate(10); ->paginate(10);

Loading…
Cancel
Save