OrderscourierController.php
1.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
<?php
namespace app\admin\controller;
use app\admin\model\RouteModel;
use cmf\controller\AdminBaseController;
use think\Db;
class OrderscourierController extends AdminBaseController{
/**
*平台订单列表
*/
public function order_list(){
if($this -> request -> isPost()){
$where = [
"indent_type" => 1
];
if(!empty($_POST['start_time']) && !empty($_POST['end_time'])){
$start_time = strtotime($_POST['start_time']);
$end_time = strtotime($_POST['end_time']);
$where['create_time'] = [['>=',$start_time],['<=',$end_time]];
}
if(!empty($_POST['keyword'])){
$where['order_number'] = $_POST['keyword'];
}
if(!empty($_POST['state'])){
$where['state'] = $_POST['state'];
}
$data = Db::name('indent') -> where($where) -> where("state = 2 or state = 3 or state = 5") -> paginate(12);
}else{
$data = Db::name('indent') -> where('indent_type','1') -> where("state = 2 or state = 3 or state = 5") -> paginate(12);
}
$this -> assign('data',$data);
return $this -> fetch();
}
}