ReturnsData.php
9.52 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
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
<?php
namespace LibModels\Web\Home;
use Api\Yohobuy;
use Api\Sign;
class ReturnsData
{
const URI_SEND_MESSAGE = 'inbox/service/v1/inbox';
/**
* 退换货订单列表数据
* @param $uid
* @param int $limit
* @param int $page
* @return mixed
*/
public static function getReturnsData($uid, $limit = 10, $page = 1)
{
$param = array();
$param = Yohobuy::param();
$param['method'] = 'app.refund.getList';
$param['uid'] = $uid;
$param['limit'] = $limit;
$param['page'] = $page;
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::post(API_URL, $param);
}
/**
* 可退货商品列表
* @param $orderCode
* @param $uid
* @return mixed
*/
public static function getRefundGoodsList($orderCode, $uid)
{
$param = array();
$param = Yohobuy::param();
$param['method'] = 'app.refund.goodsList';
$param['order_code'] = $orderCode;
$param['uid'] = $uid;
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::post(API_URL, $param);
}
/**
* 可换货商品列表
* @param $orderCode
* @param $uid
* @return mixed
*/
public static function getChangeGoodsList($orderCode, $uid)
{
$param = array();
$param = Yohobuy::param();
$param['method'] = 'app.change.goodsList';
$param['order_code'] = $orderCode;
$param['uid'] = $uid;
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::post(API_URL, $param);
}
/**
* 换货详情
* @param $uid
* @param $id
* @return mixed
*/
public static function getChangeDetail($uid, $id)
{
$param = array();
$param = Yohobuy::param();
$param['method'] = 'app.change.detail';
$param['uid'] = $uid;
$param['id'] = $id;
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::post(API_URL, $param);
}
/**
* 退货详情
* @param $uid
* @param $id
* @return mixed
*/
public static function getRefundDetail($uid, $id)
{
$param = array();
$param = Yohobuy::param();
$param['method'] = 'app.refund.detail';
$param['uid'] = $uid;
$param['id'] = $id;
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::post(API_URL, $param);
}
/**
* 快递公司列表
* @return mixed
*/
public static function getExpressCompany()
{
$param = array();
$param = Yohobuy::param();
$param['method'] = 'app.express.getExpressCompany';
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::post(API_URL, $param);
}
/**
* 设置快递
* @param $id
* @param $expressId
* @param $expressNumber
* @param $uid
* @param $expressCompany
* @param $isChange
* @return mixed
*/
public static function setExpressNumber($id, $expressId, $expressNumber,$uid, $expressCompany, $isChange)
{
$param = array();
$param = Yohobuy::param();
$param['method'] = $isChange ? 'app.change.setexpress' : 'app.refund.setexpress';
$param['id'] = $id;
$param['express_id'] = $expressId;
$param['express_number'] = $expressNumber;
$param['uid'] = $uid;
$param['express_company'] = $expressCompany;
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::post(API_URL, $param);
}
/**
* 可退货商品列表数据
* @param $orderCode
* @param $uid
* @return mixed
*/
public static function getRefundGoodsData($orderCode, $uid)
{
$param = array();
$param = Yohobuy::param();
$param['method'] = 'app.refund.goodsList';
$param['order_code'] = $orderCode;
$param['uid'] = $uid;
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::post(API_URL, $param);
}
/**
* 可换货商品列表数据
* @param $orderCode
* @param $uid
* @return mixed
*/
public static function getChangeGoodsData($orderCode, $uid)
{
$param = array();
$param = Yohobuy::param();
$param['method'] = 'app.change.goodsList';
$param['order_code'] = $orderCode;
$param['uid'] = $uid;
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::post(API_URL, $param);
}
/**
* save退货申请
* @param $orderCode
* @param $uid
* @param $goods
* @param $payment
* @return mixed
*/
public static function refundSubmit($orderCode, $uid, $goods, $payment)
{
$param = array();
$param = Yohobuy::param();
$param['method'] = 'app.refund.submit';
$param['order_code'] = $orderCode;
$param['uid'] = $uid;
$param['goods'] = json_encode($goods);
$param['payment'] = json_encode($payment);
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::post(API_URL, $param);
}
/**
* save换货申请
* @param $orderCode
* @param $uid
* @param $goods
* @param $consigneeName
* @param $areaCode
* @param $address
* @param $mobile
* @param $zipCode
* @param $deliveryType
* @return mixed
*/
public static function exchangeSubmit($orderCode, $uid, $goods, $consigneeName, $areaCode, $address, $mobile, $zipCode, $deliveryType)
{
$param = array();
$param = Yohobuy::param();
$param['method'] = 'app.change.submit';
$param['order_code'] = $orderCode;
$param['uid'] = $uid;
$param['goods'] = json_encode($goods);
$param['consignee_name'] = $consigneeName;
$param['area_code'] = $areaCode;
$param['address'] = $address;
$param['mobile'] = $mobile;
$param['zip_code'] = $zipCode;
$param['delivery_tpye'] = $deliveryType;
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::post(API_URL, $param);
}
/**
* 取消退货申请
* @param $id
* @param $uid
* @return mixed
*/
public static function cancelRefund($id, $uid)
{
$param = Yohobuy::param();
$param['method'] = 'app.refund.cancel';
$param['id'] = $id;
$param['uid'] = $uid;
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::post(API_URL, $param);
}
/**
* 取消换货申请
* @param $id
* @param $uid
* @return mixed
*/
public static function cancelChange($id, $uid)
{
$param = Yohobuy::param();
$param['method'] = 'app.change.cancel';
$param['id'] = $id;
$param['uid'] = $uid;
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::post(API_URL, $param);
}
/**
* 获取换货方式
* @param $uid
* @param $areaCode
* @param $gender
* @param $yhChannel
* @return mixed
*/
public static function getDelivery($uid, $areaCode, $gender, $yhChannel)
{
$param = array();
$param = Yohobuy::param();
$param['method'] = 'app.change.getDelivery';
$param['uid'] = $uid;
$param['area_code'] = $areaCode;
$param['gender'] = $gender;
$param['yh_channel'] = $yhChannel;
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::post(API_URL, $param);
}
/**
* 获取商品信息
* @param $productSkn
* @return mixed
*/
public static function getProductData($productSkn)
{
$param = array();
$param = Yohobuy::param();
$param['method'] = 'app.product.data';
$param['product_skn'] = $productSkn;
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::post(API_URL, $param);
}
/**
* 获取商品信息(组装批量调接口)
* @param $productSkn
* @return string
*/
public static function getProductDataUrl($productSkn)
{
$param = array();
$param = Yohobuy::param();
$param['method'] = 'app.product.data';
$param['product_skn'] = $productSkn;
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::httpBuildQuery(API_URL, $param);
}
/**
* 发送站内信
*
* @param int $uid
* @param string $title
* @param int $content
* @param int $type
* @param string $verify_key
* @param int $send_uid
* @param string $call_back
* @return array
*/
public static function sendMessage($uid, $title, $content, $type = 1, $verify_key = '', $send_uid = 0, $call_back = '')
{
$param = array();
$param = Yohobuy::param();
$param['method'] = 'web.inbox.setSingleMessage';
$param['uid'] = $uid;
$param['send_uid'] = $send_uid;
$param['verify_key'] = $verify_key;
$param['content'] = $content;
$param['title'] = $title;
$param['type'] = $type;
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::post(API_URL, $param);
}
}