update
This commit is contained in:
parent
7bea1fabc3
commit
ae9374feb2
@ -35,8 +35,8 @@ COPY requirements.txt .
|
||||
COPY app app/
|
||||
|
||||
# 安装Python依赖
|
||||
RUN pip install -i https://mirrors.aliyun.com/pypi/simple/ --no-cache-dir -r requirements.txt \
|
||||
&& pip install --no-cache-dir uvicorn
|
||||
RUN pip install -i https://mirrors.aliyun.com/pypi/simple/ -r requirements.txt \
|
||||
&& pip install uvicorn
|
||||
|
||||
# 暴露端口
|
||||
EXPOSE 8000
|
||||
|
||||
@ -686,6 +686,7 @@ async def get_user_orders(
|
||||
PointProductOrderDB.delivery_order_id == order.orderid
|
||||
).all()
|
||||
|
||||
|
||||
orders.append({
|
||||
"orderid": order.orderid,
|
||||
"userid": order.userid,
|
||||
@ -903,6 +904,20 @@ async def deliveryman_orders(
|
||||
PointProductOrderDB.delivery_order_id == order.orderid
|
||||
).all()
|
||||
|
||||
# 计算配送时间
|
||||
delivery_time = "预计 今日 送达"
|
||||
|
||||
# 如果配送时段不为空,则使用配送时段的时间
|
||||
if order.time_period_id:
|
||||
if order.delivery_date == datetime.now().date():
|
||||
delivery_time = f"今日 {order.time_period_name}"
|
||||
elif order.delivery_date == datetime.now().date() + timedelta(days=1):
|
||||
delivery_time = f"明日 {order.time_period_name}"
|
||||
else:
|
||||
delivery_time = f"{order.delivery_date} {order.time_period_name}"
|
||||
else:
|
||||
delivery_time = f"今日"
|
||||
|
||||
orders.append({
|
||||
"orderid": order.orderid,
|
||||
"userid": order.userid,
|
||||
@ -913,6 +928,7 @@ async def deliveryman_orders(
|
||||
"pickup_images_count": order.pickup_images_count,
|
||||
"create_time": order.create_time,
|
||||
"delivery_method": order.delivery_method,
|
||||
"delivery_time": delivery_time,
|
||||
"original_amount": order.original_amount,
|
||||
"coupon_discount_amount": order.coupon_discount_amount,
|
||||
"point_discount_amount": order.point_discount_amount,
|
||||
|
||||
Loading…
Reference in New Issue
Block a user