|
@@ -32,8 +32,9 @@ class AdminOrderController extends AdminBaseController{ |
|
@@ -32,8 +32,9 @@ class AdminOrderController extends AdminBaseController{ |
32
|
public function index(){
|
32
|
public function index(){
|
33
|
$param=$this->request->param();
|
33
|
$param=$this->request->param();
|
34
|
$where=array();
|
34
|
$where=array();
|
|
|
35
|
+ $where['a.state']=['in',[2,3]];
|
35
|
if (!empty($param['order_no'])){
|
36
|
if (!empty($param['order_no'])){
|
36
|
- $where['order_no']=['like','%'.$param['order_no'].'%'];
|
37
|
+ $where['a.order_no']=['like','%'.$param['order_no'].'%'];
|
37
|
}
|
38
|
}
|
38
|
if (!empty($param['mobile'])){
|
39
|
if (!empty($param['mobile'])){
|
39
|
$where['u.mobile']=['like','%'.$param['mobile'].'%'];
|
40
|
$where['u.mobile']=['like','%'.$param['mobile'].'%'];
|
|
@@ -41,20 +42,23 @@ class AdminOrderController extends AdminBaseController{ |
|
@@ -41,20 +42,23 @@ class AdminOrderController extends AdminBaseController{ |
41
|
if (!empty($param['users_id'])){
|
42
|
if (!empty($param['users_id'])){
|
42
|
$where['u.id']=$param['users_id'];
|
43
|
$where['u.id']=$param['users_id'];
|
43
|
}
|
44
|
}
|
44
|
- $where['state']=['in',[2,3]];
|
45
|
+ if (!empty($param['state'])){
|
|
|
46
|
+ $where['a.state']=$param['state'];
|
|
|
47
|
+ }
|
45
|
$Order=new OrderModel();
|
48
|
$Order=new OrderModel();
|
46
|
$data=$Order->alias('a')
|
49
|
$data=$Order->alias('a')
|
47
|
->join('users u','a.users_id=u.id')
|
50
|
->join('users u','a.users_id=u.id')
|
48
|
// ->field('a.*,b.serial_number,b.hospital')
|
51
|
// ->field('a.*,b.serial_number,b.hospital')
|
49
|
// ->join('equipment b','a.eq_name=b.name')
|
52
|
// ->join('equipment b','a.eq_name=b.name')
|
50
|
->where($where)
|
53
|
->where($where)
|
51
|
- ->order('end_time','desc')
|
54
|
+ ->order('a.end_time','desc')
|
52
|
->paginate(10);
|
55
|
->paginate(10);
|
53
|
$this->assign('data',$data);
|
56
|
$this->assign('data',$data);
|
54
|
$this->assign('hospital', isset($param['hospital']) ? $param['hospital'] : '');
|
57
|
$this->assign('hospital', isset($param['hospital']) ? $param['hospital'] : '');
|
55
|
$this->assign('order_no', isset($param['order_no']) ? $param['order_no'] : '');
|
58
|
$this->assign('order_no', isset($param['order_no']) ? $param['order_no'] : '');
|
56
|
$this->assign('mobile', isset($param['mobile']) ? $param['mobile'] : '');
|
59
|
$this->assign('mobile', isset($param['mobile']) ? $param['mobile'] : '');
|
57
|
$this->assign('users_id', isset($param['users_id']) ? $param['users_id'] : '');
|
60
|
$this->assign('users_id', isset($param['users_id']) ? $param['users_id'] : '');
|
|
|
61
|
+ $this->assign('state', isset($param['state']) ? $param['state'] : '');
|
58
|
$this->assign('start_number', isset($param['start_number']) ? $param['start_number'] : '');
|
62
|
$this->assign('start_number', isset($param['start_number']) ? $param['start_number'] : '');
|
59
|
$this->assign('end_number', isset($param['end_number']) ? $param['end_number'] : '');
|
63
|
$this->assign('end_number', isset($param['end_number']) ? $param['end_number'] : '');
|
60
|
return $this->fetch();
|
64
|
return $this->fetch();
|