OrderAftersale.php
3.8 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
<?php
namespace app\api\controller;
/**
* 售后接口
*/
class OrderAftersale extends Base
{
protected $noNeedLogin = [];
protected $noNeedRight = ['*'];
/**
* @ApiWeigh (99)
* @ApiTitle (售后列表)
* @ApiSummary (售后列表)
* @ApiMethod (GET)
*
* @ApiHeaders (name=token, type=string, required=true, description="请求的Token")
* @ApiParams (name=type, type=string, required=false, description="售后类型:all=全部")
*
* @ApiReturn()
*/
public function index()
{
$params = $this->request->get();
$this->success('售后列表', \addons\shopro\model\OrderAftersale::getList($params));
}
/**
* @ApiWeigh (97)
* @ApiTitle (详情)
* @ApiSummary (详情)
* @ApiMethod (GET)
*
* @ApiHeaders (name=token, type=string, required=true, description="请求的Token")
* @ApiParams (name=id, type=inter, required=true, description="售后ID")
*
* @ApiReturn()
*/
public function detail()
{
$params = $this->request->get();
$this->shoproValidate($params, get_class(), 'detail');
$data = \addons\shopro\model\OrderAftersale::detail($params);
// 处理售后时间
foreach ($data['logs'] as $v){
$v->createtime = date('Y-m-d H:i:s',$v->createtime);
}
$this->success('售后详情', $data);
}
/**
* @ApiWeigh (95)
* @ApiTitle (申请售后)
* @ApiSummary (申请售后)
* @ApiMethod (POST)
*
* @ApiHeaders (name=token, type=string, required=true, description="请求的Token")
* @ApiParams (name=type, type=string, required=true, description="类型:refund=退款,return=退货,other=其他")
* @ApiParams (name=order_id, type=inter, required=true, description="订单ID")
* @ApiParams (name=order_item_id, type=inter, required=true, description="订单商品ID")
* @ApiParams (name=phone, type=string, required=true, description="联系方式")
* @ApiParams (name=reason, type=string, required=false, description="售后原因")
* @ApiParams (name=content, type=string, required=false, description="售后原因内容")
* @ApiParams (name=images, type=string, required=false, description="售后图片,数组")
*
* @ApiReturn()
*/
public function aftersale()
{
$params = $this->request->post();
// 表单验证
$this->shoproValidate($params, get_class(), 'aftersale');
$this->success('申请成功', \addons\shopro\model\OrderAftersale::aftersale($params));
}
/**
* @ApiWeigh (93)
* @ApiTitle (取消售后单)
* @ApiSummary (取消售后单)
* @ApiMethod (POST)
*
* @ApiHeaders (name=token, type=string, required=true, description="请求的Token")
* @ApiParams (name=id, type=inter, required=true, description="售后ID")
*
* @ApiReturn()
*/
public function cancel()
{
$params = $this->request->post();
// 表单验证
$this->shoproValidate($params, get_class(), 'cancel');
$this->success('取消成功', \addons\shopro\model\OrderAftersale::operCancel($params));
}
/**
* @ApiWeigh (91)
* @ApiTitle (删除售后单)
* @ApiSummary (删除售后单)
* @ApiMethod (POST)
*
* @ApiHeaders (name=token, type=string, required=true, description="请求的Token")
* @ApiParams (name=id, type=inter, required=true, description="售后ID")
*
* @ApiReturn()
*/
public function delete()
{
$params = $this->request->post();
// 表单验证
$this->shoproValidate($params, get_class(), 'delete');
$this->success('删除成功', \addons\shopro\model\OrderAftersale::operDelete($params));
}
}