request->input('order_id'); $type = (int)$this->request->input('order_type'); $orderInfo = $this->orderModel->getInfoById($orderId); if ($orderInfo->status != OrderCode::PAYED) throw new ErrException('该订单状态已变更,请勿重复操作,刷新后无法退款请联系客服'); $payInfo = $this->payOrderModel->getInfoByOrderIdAndType($orderInfo->id,OrderCode::ORDER_TYPE_GOOD); if (empty($payInfo)) throw new ErrException('订单支付信息不存在'); //立即取消 $this->joinRefundQueue($orderId, RefundCode::FULL_GOOD_REFUND, '用户主动取消订单'); return $this->return->success(); } }