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

11

... ... @@ -228,9 +228,12 @@ class Order extends Api
/**
* 我的订单-申请退款
* @ApiMethod (GET)
* @ApiMethod (POST)
* @ApiHeaders (name=token, type=string, required=true, description="请求的Token")
* @ApiParams (name="order_id", type="integer", required=true, description="订单ID")
* @ApiParams (name="refund_reason", type="string", required=true, description="退款原因")
* @ApiParams (name="refund_reason_explain", type="string", required=true, description="退款说明")
* @ApiParams (name="refund_reason_images", type="string", required=true, description="退款凭证,多个图片用英文逗号分隔")
* @ApiReturnParams (name="code", type="integer", required=true, sample="0")
* @ApiReturnParams (name="msg", type="string", required=true, sample="返回成功")
* @ApiReturnParams (name="data", type="object", description="扩展数据返回")
... ... @@ -239,14 +242,18 @@ class Order extends Api
'msg':'返回成功'
})
*/
public function refund($order_id)
public function refund()
{
if(!$order = $this->model->getUserOrderDetail($order_id, $this->user['id'])){
$post = $this->request->post();
if(!$order = $this->model->getUserOrderDetail($post['order_id'], $this->user['id'])){
$this->error($this->model->getError());
}
if ($order['refund_status'] == 2) return self::setErrorInfo('订单已退款!');
if ($order['refund_status'] == 1) return self::setErrorInfo('正在申请退款中!');
if ($order['status'] == 1) return self::setErrorInfo('订单当前无法退款!');
empty($post['refund_reason']) && $this->error(__('请选择退款原因!'));
$order['refund_status'] == '2' && $this->error(__('订单已退款!'));
$order['refund_status'] == '1' && $this->error(__('正在申请退款中!'));
$order['delivery_status'] == '1' && $this->error(__('订单当前无法退款!'));
$this->model->allowField(true)->save($post);
$this->success(__('申请退款成功'));
}
/**
... ... @@ -268,5 +275,6 @@ class Order extends Api
if(!$order = $this->model->getUserOrderDetail($post['order_id'], $this->user['id'])){
$this->error($this->model->getError());
}
}
}
... ...
... ... @@ -111,7 +111,7 @@ class User extends Api
*/
public function memberIntro()
{
$member_intro = str_replace('src="/uploads/', 'src="'.cdnurl('/uploads/'), config('site.member_intro'));
$member_intro = str_replace('src="/uploads/', 'src="'.cdnurl('/uploads/',true), config('site.member_intro'));
$this->success(__('成功'),compact('member_intro'));
}
... ... @@ -588,7 +588,7 @@ class User extends Api
*/
public function measure()
{
$measure = str_replace('src="/uploads/', 'src="'.cdnurl('/uploads/'), config('site.measure'));
$measure = str_replace('src="/uploads/', 'src="'.cdnurl('/uploads/',true), config('site.measure'));
$this->success(__('成功'),compact('measure'));
}
}
... ...