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

11

@@ -228,9 +228,12 @@ class Order extends Api @@ -228,9 +228,12 @@ class Order extends Api
228 228
229 /** 229 /**
230 * 我的订单-申请退款 230 * 我的订单-申请退款
231 - * @ApiMethod (GET) 231 + * @ApiMethod (POST)
232 * @ApiHeaders (name=token, type=string, required=true, description="请求的Token") 232 * @ApiHeaders (name=token, type=string, required=true, description="请求的Token")
233 * @ApiParams (name="order_id", type="integer", required=true, description="订单ID") 233 * @ApiParams (name="order_id", type="integer", required=true, description="订单ID")
  234 + * @ApiParams (name="refund_reason", type="string", required=true, description="退款原因")
  235 + * @ApiParams (name="refund_reason_explain", type="string", required=true, description="退款说明")
  236 + * @ApiParams (name="refund_reason_images", type="string", required=true, description="退款凭证,多个图片用英文逗号分隔")
234 * @ApiReturnParams (name="code", type="integer", required=true, sample="0") 237 * @ApiReturnParams (name="code", type="integer", required=true, sample="0")
235 * @ApiReturnParams (name="msg", type="string", required=true, sample="返回成功") 238 * @ApiReturnParams (name="msg", type="string", required=true, sample="返回成功")
236 * @ApiReturnParams (name="data", type="object", description="扩展数据返回") 239 * @ApiReturnParams (name="data", type="object", description="扩展数据返回")
@@ -239,14 +242,18 @@ class Order extends Api @@ -239,14 +242,18 @@ class Order extends Api
239 'msg':'返回成功' 242 'msg':'返回成功'
240 }) 243 })
241 */ 244 */
242 - public function refund($order_id) 245 + public function refund()
243 { 246 {
244 - if(!$order = $this->model->getUserOrderDetail($order_id, $this->user['id'])){ 247 + $post = $this->request->post();
  248 + if(!$order = $this->model->getUserOrderDetail($post['order_id'], $this->user['id'])){
245 $this->error($this->model->getError()); 249 $this->error($this->model->getError());
246 - }  
247 - if ($order['refund_status'] == 2) return self::setErrorInfo('订单已退款!');  
248 - if ($order['refund_status'] == 1) return self::setErrorInfo('正在申请退款中!');  
249 - if ($order['status'] == 1) return self::setErrorInfo('订单当前无法退款!'); 250 + }
  251 + empty($post['refund_reason']) && $this->error(__('请选择退款原因!'));
  252 + $order['refund_status'] == '2' && $this->error(__('订单已退款!'));
  253 + $order['refund_status'] == '1' && $this->error(__('正在申请退款中!'));
  254 + $order['delivery_status'] == '1' && $this->error(__('订单当前无法退款!'));
  255 + $this->model->allowField(true)->save($post);
  256 + $this->success(__('申请退款成功'));
250 } 257 }
251 258
252 /** 259 /**
@@ -268,5 +275,6 @@ class Order extends Api @@ -268,5 +275,6 @@ class Order extends Api
268 if(!$order = $this->model->getUserOrderDetail($post['order_id'], $this->user['id'])){ 275 if(!$order = $this->model->getUserOrderDetail($post['order_id'], $this->user['id'])){
269 $this->error($this->model->getError()); 276 $this->error($this->model->getError());
270 } 277 }
  278 +
271 } 279 }
272 } 280 }
@@ -111,7 +111,7 @@ class User extends Api @@ -111,7 +111,7 @@ class User extends Api
111 */ 111 */
112 public function memberIntro() 112 public function memberIntro()
113 { 113 {
114 - $member_intro = str_replace('src="/uploads/', 'src="'.cdnurl('/uploads/'), config('site.member_intro')); 114 + $member_intro = str_replace('src="/uploads/', 'src="'.cdnurl('/uploads/',true), config('site.member_intro'));
115 $this->success(__('成功'),compact('member_intro')); 115 $this->success(__('成功'),compact('member_intro'));
116 } 116 }
117 117
@@ -588,7 +588,7 @@ class User extends Api @@ -588,7 +588,7 @@ class User extends Api
588 */ 588 */
589 public function measure() 589 public function measure()
590 { 590 {
591 - $measure = str_replace('src="/uploads/', 'src="'.cdnurl('/uploads/'), config('site.measure')); 591 + $measure = str_replace('src="/uploads/', 'src="'.cdnurl('/uploads/',true), config('site.measure'));
592 $this->success(__('成功'),compact('measure')); 592 $this->success(__('成功'),compact('measure'));
593 } 593 }
594 } 594 }