Order.php
3.4 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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
<?php
namespace addons\shopro\controller;
class Order extends Base
{
protected $noNeedLogin = [];
protected $noNeedRight = ['*'];
public function index()
{
$params = $this->request->get();
$this->success('订单列表', \addons\shopro\model\Order::getList($params));
}
public function detail()
{
$params = $this->request->get();
$this->success('订单详情', \addons\shopro\model\Order::detail($params));
}
public function itemDetail()
{
$params = $this->request->get();
$this->success('订单商品', \addons\shopro\model\Order::itemDetail($params));
}
//
public function statusNum () {
$this->success('订单数量', \addons\shopro\model\Order::statusNum());
}
// 取消订单
public function cancel()
{
$params = $this->request->post();
// 表单验证
$this->shoproValidate($params, get_class(), 'cancel');
$this->success('取消成功', \addons\shopro\model\Order::operCancel($params));
}
// 删除订单
public function delete()
{
$params = $this->request->post();
// 表单验证
$this->shoproValidate($params, get_class(), 'delete');
$this->success('删除成功', \addons\shopro\model\Order::operDelete($params));
}
// 确认收货
public function confirm()
{
$params = $this->request->post();
// 表单验证
$this->shoproValidate($params, get_class(), 'confirm');
$this->success('收货成功', \addons\shopro\model\Order::operConfirm($params));
}
// 申请售后 (已废弃)
// public function aftersale()
// {
// $params = $this->request->post();
// // 表单验证
// $this->shoproValidate($params, get_class(), 'aftersale');
// $this->success('申请成功', \addons\shopro\model\Order::operAftersale($params));
// }
// 申请退款 (已废弃)
// public function refund()
// {
// $params = $this->request->post();
// // 表单验证
// $this->shoproValidate($params, get_class(), 'refund');
// $this->success('申请成功', \addons\shopro\model\Order::operRefund($params));
// }
public function comment ()
{
$params = $this->request->post();
// 表单验证
$this->shoproValidate($params, get_class(), 'comment');
$this->success('评价成功', \addons\shopro\model\Order::operComment($params));
}
public function pre()
{
$params = $this->request->post();
// 表单验证
$this->shoproValidate($params, get_class(), 'pre');
$result = \addons\shopro\model\Order::pre($params);
$this->success('计算成功', $result);
}
public function createOrder()
{
$params = $this->request->post();
// 表单验证
$this->shoproValidate($params, get_class(), 'createOrder');
$order = \addons\shopro\model\Order::createOrder($params);
$this->success('订单添加成功', $order);
}
// 获取可用优惠券列表
public function coupons () {
$params = $this->request->post();
// 表单验证
$this->shoproValidate($params, get_class(), 'coupons');
$coupons = \addons\shopro\model\Order::coupons($params);
$this->success('获取成功', $coupons);
}
}