This commit is contained in:
aaron 2025-04-02 10:23:28 +08:00
parent b3f6b12f14
commit 07c4f76701
2 changed files with 3 additions and 0 deletions

View File

@ -855,6 +855,9 @@ async def cancel_order(
if order.status not in [OrderStatus.CREATED, OrderStatus.UNPAID]: if order.status not in [OrderStatus.CREATED, OrderStatus.UNPAID]:
return error_response(code=400, message="当前订单状态不可取消") return error_response(code=400, message="当前订单状态不可取消")
if order.deliveryman_user_id:
return error_response(code=400, message="当前订单已接单,无法取消")
try: try:
# 更新订单状态、取消原因和取消用户 # 更新订单状态、取消原因和取消用户
order.status = OrderStatus.CANCELLED order.status = OrderStatus.CANCELLED

Binary file not shown.