OrderscourierController.php
2.3 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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
<?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(1000000);
}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();
}
/**
*平台订单查看
*/
public function plat_view(){
$id = $this -> request -> param();
$indent_id = $id['id'];
$data_goods = Db::name('indent_goods') -> where('indent_id',$indent_id) -> select();
$data_in = Db::name('indent') -> where('id',$indent_id) -> find();
$this -> assign('data_goods',$data_goods);
$this -> assign('data_in',$data_in);
//地址查询
$address = Db::name('address') -> where("id",$data_in['indent_address']) -> find();
if(!empty($address)){
$this -> assign('address',$address);
}else{
$this -> assign('address',null);
}
return $this -> fetch();
}
/**
* 查看物流信息
*/
public function logistics_information(){
$indent_id = $this -> request -> param();
$bird = new BirdController();
$logistics = $bird -> getOrder($indent_id['id']);
$this -> assign('logistics',$logistics['data']['traces']);
return $this -> fetch();
}
}