This commit is contained in:
aaron 2025-02-26 00:00:45 +08:00
parent e672b86e1c
commit 35875c8f72

View File

@ -407,6 +407,9 @@ async def get_order_detail(
else: else:
package_list = [] package_list = []
# 计算配送时间
delivery_time = "预计明日送达" if datetime.now() > datetime.now().replace(hour=settings.ORDER_SPLIT_TIME_HOUR, minute=0, second=0) else "预计今日送达"
# 构建响应数据 # 构建响应数据
order_data = { order_data = {
"orderid": order.orderid, "orderid": order.orderid,
@ -444,7 +447,10 @@ async def get_order_detail(
"building_id": order.address_community_building_id, "building_id": order.address_community_building_id,
"building_name": order.address_community_building_name, "building_name": order.address_community_building_name,
"community_id": order.address_community_id, "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) return success_response(data=order_data)