From 0d2e503965629b0939a4441cc18ca49502da87e4 Mon Sep 17 00:00:00 2001 From: aaron <> Date: Tue, 25 Feb 2025 11:42:12 +0800 Subject: [PATCH] 1 --- app/api/endpoints/order.py | 3 +-- app/main.py | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/app/api/endpoints/order.py b/app/api/endpoints/order.py index 14e1b8e..e929080 100644 --- a/app/api/endpoints/order.py +++ b/app/api/endpoints/order.py @@ -352,8 +352,7 @@ async def get_order_detail( # 计算配送员分账金额 deliveryman_share = 0 - - if current_user.delivery_commission_rate: + if current_user.delivery_commission_rate is not None: deliveryman_share = round(order.original_amount * (current_user.delivery_commission_rate / 100.0), 1) # 如果有配送员 id,则获取配送员信息 diff --git a/app/main.py b/app/main.py index 6d1a9de..029d6ec 100644 --- a/app/main.py +++ b/app/main.py @@ -95,6 +95,6 @@ async def exception_handler(request, exc): await wecom_bot.send_markdown(exception_log) return CustomJSONResponse( - status_code=exc.status_code, + status_code=500, content=str(exc) ) \ No newline at end of file