作者 刘朕
1 个管道 的构建 通过 耗费 1 秒

后台业务员列表筛选优化

... ... @@ -14,27 +14,32 @@ class SalesmanorderController extends AdminBaseController{
public function sale_order_list(){
$param = $this->request->param();
$where = [
'indent_type' => 2
'i.indent_type' => 2
];
if(!empty($param['user_id'])){
$where['uid'] = $param['user_id'];
$where['mu.id'] = $param['user_id'];
}
if(!empty($param['keyword'])){
$where['order_number|name|phone'] = ['like','%'.trim($param['keyword']).'%'];
$where['i.order_number|i.name|i.phone'] = ['like','%'.trim($param['keyword']).'%'];
}
if(!empty($param['state'])){
$where['state'] = $param['state'];
$where['i.state'] = $param['state'];
}
if(!empty($param['uid'])){
$where['salesman_uid'] = $param['uid'];
$where['i.salesman_uid'] = $param['uid'];
}
if(!empty($param['school'])){
$where['school'] = $param['school'];
$where['i.school'] = $param['school'];
}
if(!empty($param['grade'])){
$where['grade'] = $param['grade'];
$where['i.grade'] = $param['grade'];
}
$data = Db::name('indent') -> where($where)->order('create_time','DESC') -> paginate(12);
$data = Db::name('indent')->alias('i')
->field('i.*,mu.id as muid')
->join('__MY_USER__ mu','i.uid = mu.uid')
->where($where)
->order('i.create_time','DESC')
->paginate(12);
$data->appends($param);
$data_arr = $data -> toArray();
$money = 0;
... ...
... ... @@ -77,7 +77,7 @@
<tr class="tr{$vo.id}">
<td>{$vo.id}</td>
<td>{$vo.order_number}</td>
<td>{$vo.uid}</td>
<td>{$vo.muid}</td>
<td>{$vo.name}</td>
<td>{$vo.phone}</td>
<td>{$vo.region}</td>
... ...