...
|
...
|
@@ -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;
|
...
|
...
|
|