validate([ 'refund_id' => 'required|filled|integer', ]); $this->refundApply = RefundApply::find(request()->input('refund_id')); if (!isset($this->refundApply)) { throw new AppException('售后申请记录不存在'); } if ($this->refundApply->uid != \YunShop::app()->getMemberId()) { throw new AppException('无效申请,该订单属于其他用户'); } } /** * @return \Illuminate\Http\JsonResponse * @throws \app\common\exceptions\AppException * @throws \app\common\exceptions\ShopException */ public function send() { $this->validate([ 'express_company_code' => 'required|string', 'express_company_name' => 'required|string', 'express_sn' => 'required|filled|string', ]); RefundOperationService::refundSendBack(['refund_id'=> request()->input('refund_id')]); return $this->successJson('操作成功'); } /** * @return \Illuminate\Http\JsonResponse * @throws \app\common\exceptions\AppException * @throws \app\common\exceptions\ShopException */ public function complete() { RefundOperationService::refundExchangeComplete(['refund_id'=> request()->input('refund_id')]); return $this->successJson('操作成功'); } /** * @return \Illuminate\Http\JsonResponse * @throws \app\common\exceptions\AppException * @throws \app\common\exceptions\ShopException */ public function cancel() { RefundOperationService::refundCancel(['refund_id'=> request()->input('refund_id')]); return $this->successJson('操作成功'); } }