diff --git a/app/api/endpoints/order.py b/app/api/endpoints/order.py index ce2b035..542a7c1 100644 --- a/app/api/endpoints/order.py +++ b/app/api/endpoints/order.py @@ -407,6 +407,9 @@ async def get_order_detail( else: package_list = [] + # 计算配送时间 + delivery_time = "预计明日送达" if datetime.now() > datetime.now().replace(hour=settings.ORDER_SPLIT_TIME_HOUR, minute=0, second=0) else "预计今日送达" + # 构建响应数据 order_data = { "orderid": order.orderid, @@ -444,7 +447,10 @@ async def get_order_detail( "building_id": order.address_community_building_id, "building_name": order.address_community_building_name, "community_id": order.address_community_id, - "community_name": order.address_community_name + "community_name": order.address_community_name, + + # 配送时间 + "delivery_time": delivery_time } return success_response(data=order_data)