getId(); $userId = $this->user_id; // 参数验证 if (!$orderId || $orderId <= 0) { throw new LogicException("订单ID无效"); } // 调用服务取消订单 $result = MexOrderService::cancelOrder($userId, $orderId); // 检查操作结果 if (!$result['success']) { throw new LogicException($result['message'] ?? '取消订单失败'); } // 更新用户活动时间 $this->updateUserActivityTime(); } catch (\Exception $e) { // 系统异常 Log::error('取消挂单系统异常', [ 'user_id' => $this->user_id, 'order_id' => $orderId ?? 0, 'error' => $e->getMessage(), 'trace' => $e->getTraceAsString() ]); $this->response->setCode(RESPONSE_CODE::SERVER_ERROR); $this->response->setMsg('系统繁忙,请稍后重试'); } return $response; } }