作者 何书鹏
1 个管道 的构建 通过 耗费 0 秒

1

@@ -33,9 +33,8 @@ class Order extends Api @@ -33,9 +33,8 @@ class Order extends Api
33 'msg':'返回成功' 33 'msg':'返回成功'
34 }) 34 })
35 */ 35 */
36 - public function index() 36 + public function index($type)
37 { 37 {
38 - $type = $this->request->get('type');  
39 $list = $this->model->getList($this->user['id'], $type); 38 $list = $this->model->getList($this->user['id'], $type);
40 $this->success(__('成功'),compact('list')); 39 $this->success(__('成功'),compact('list'));
41 } 40 }
@@ -54,10 +53,8 @@ class Order extends Api @@ -54,10 +53,8 @@ class Order extends Api
54 'msg':'返回成功' 53 'msg':'返回成功'
55 }) 54 })
56 */ 55 */
57 - public function editAddress() 56 + public function editAddress($order_id,$user_address_id)
58 { 57 {
59 - $order_id = $this->request->get('order_id',0);  
60 - $user_address_id = $this->request->get('user_address_id',0);  
61 if(!$order = $this->model->getUserOrderDetail($order_id, $this->user['id'])){ 58 if(!$order = $this->model->getUserOrderDetail($order_id, $this->user['id'])){
62 $this->error($this->model->getError()); 59 $this->error($this->model->getError());
63 } 60 }
@@ -88,9 +85,8 @@ class Order extends Api @@ -88,9 +85,8 @@ class Order extends Api
88 'msg':'返回成功' 85 'msg':'返回成功'
89 }) 86 })
90 */ 87 */
91 - public function detail() 88 + public function detail($order_id)
92 { 89 {
93 - $order_id = $this->request->get('order_id',0);  
94 if(!$order = $this->model->getUserOrderDetail($order_id, $this->user['id'])){ 90 if(!$order = $this->model->getUserOrderDetail($order_id, $this->user['id'])){
95 $this->error($this->model->getError()); 91 $this->error($this->model->getError());
96 } 92 }
@@ -110,9 +106,8 @@ class Order extends Api @@ -110,9 +106,8 @@ class Order extends Api
110 'msg':'返回成功' 106 'msg':'返回成功'
111 }) 107 })
112 */ 108 */
113 - public function cancel() 109 + public function cancel($order_id)
114 { 110 {
115 - $order_id = $this->request->get('order_id',0);  
116 if(!$order = $this->model->getUserOrderDetail($order_id, $this->user['id'])){ 111 if(!$order = $this->model->getUserOrderDetail($order_id, $this->user['id'])){
117 $this->error($this->model->getError()); 112 $this->error($this->model->getError());
118 } 113 }
@@ -135,9 +130,8 @@ class Order extends Api @@ -135,9 +130,8 @@ class Order extends Api
135 'msg':'返回成功' 130 'msg':'返回成功'
136 }) 131 })
137 */ 132 */
138 - public function pay() 133 + public function pay($order_id)
139 { 134 {
140 - $order_id = $this->request->get('order_id',0);  
141 if(!$order = $this->model->getUserOrderDetail($order_id, $this->user['id'])){ 135 if(!$order = $this->model->getUserOrderDetail($order_id, $this->user['id'])){
142 $this->error($this->model->getError()); 136 $this->error($this->model->getError());
143 } 137 }
@@ -173,9 +167,8 @@ class Order extends Api @@ -173,9 +167,8 @@ class Order extends Api
173 'msg':'返回成功' 167 'msg':'返回成功'
174 }) 168 })
175 */ 169 */
176 - public function remind() 170 + public function remind($order_id)
177 { 171 {
178 - $order_id = $this->request->get('order_id',0);  
179 if(!$order = $this->model->getUserOrderDetail($order_id, $this->user['id'])){ 172 if(!$order = $this->model->getUserOrderDetail($order_id, $this->user['id'])){
180 $this->error($this->model->getError()); 173 $this->error($this->model->getError());
181 } 174 }
@@ -198,9 +191,8 @@ class Order extends Api @@ -198,9 +191,8 @@ class Order extends Api
198 'msg':'返回成功' 191 'msg':'返回成功'
199 }) 192 })
200 */ 193 */
201 - public function receive() 194 + public function receive($order_id)
202 { 195 {
203 - $order_id = $this->request->get('order_id',0);  
204 if(!$order = $this->model->getUserOrderDetail($order_id, $this->user['id'])){ 196 if(!$order = $this->model->getUserOrderDetail($order_id, $this->user['id'])){
205 $this->error($this->model->getError()); 197 $this->error($this->model->getError());
206 } 198 }
@@ -223,17 +215,15 @@ class Order extends Api @@ -223,17 +215,15 @@ class Order extends Api
223 'msg':'返回成功' 215 'msg':'返回成功'
224 }) 216 })
225 */ 217 */
226 - public function refundView() 218 + public function refundView($order_id)
227 { 219 {
228 - $order_id = $this->request->get('order_id',0);  
229 if(!$order = $this->model->getUserOrderDetail($order_id, $this->user['id'])){ 220 if(!$order = $this->model->getUserOrderDetail($order_id, $this->user['id'])){
230 $this->error($this->model->getError()); 221 $this->error($this->model->getError());
231 } 222 }
232 - halt($order);  
233 $refund_reason = config('site.refundreason') ?: [];//退款理由 223 $refund_reason = config('site.refundreason') ?: [];//退款理由
234 $refund_reason = str_replace("\r\n", "\n", $refund_reason);//防止不兼容 224 $refund_reason = str_replace("\r\n", "\n", $refund_reason);//防止不兼容
235 $refund_reason = explode("\n", $refund_reason); 225 $refund_reason = explode("\n", $refund_reason);
236 - $this->success(__('成功'),compact('order,refund_reason')); 226 + $this->success(__('成功'),compact('order','refund_reason'));
237 } 227 }
238 228
239 /** 229 /**
@@ -277,9 +267,8 @@ class Order extends Api @@ -277,9 +267,8 @@ class Order extends Api
277 'msg':'返回成功' 267 'msg':'返回成功'
278 }) 268 })
279 */ 269 */
280 - public function returnGoodsView() 270 + public function returnGoodsView($order_id)
281 { 271 {
282 - $order_id = $this->request->get('order_id',0);  
283 if(!$order = $this->model->getUserOrderDetail($order_id, $this->user['id'])){ 272 if(!$order = $this->model->getUserOrderDetail($order_id, $this->user['id'])){
284 $this->error($this->model->getError()); 273 $this->error($this->model->getError());
285 } 274 }
@@ -291,7 +280,7 @@ class Order extends Api @@ -291,7 +280,7 @@ class Order extends Api
291 $return_goods_reason = config('site.return_goods_reason') ?: []; 280 $return_goods_reason = config('site.return_goods_reason') ?: [];
292 $return_goods_reason = str_replace("\r\n", "\n", $return_goods_reason);//防止不兼容 281 $return_goods_reason = str_replace("\r\n", "\n", $return_goods_reason);//防止不兼容
293 $return_goods_reason = explode("\n", $return_goods_reason); 282 $return_goods_reason = explode("\n", $return_goods_reason);
294 - $this->success(__('成功'),compact('order,refund_reason,return_goods_reason')); 283 + $this->success(__('成功'),compact('order','refund_reason','return_goods_reason'));
295 } 284 }
296 285
297 /** 286 /**