update
This commit is contained in:
parent
7bea1fabc3
commit
ae9374feb2
@ -35,8 +35,8 @@ COPY requirements.txt .
|
|||||||
COPY app app/
|
COPY app app/
|
||||||
|
|
||||||
# 安装Python依赖
|
# 安装Python依赖
|
||||||
RUN pip install -i https://mirrors.aliyun.com/pypi/simple/ --no-cache-dir -r requirements.txt \
|
RUN pip install -i https://mirrors.aliyun.com/pypi/simple/ -r requirements.txt \
|
||||||
&& pip install --no-cache-dir uvicorn
|
&& pip install uvicorn
|
||||||
|
|
||||||
# 暴露端口
|
# 暴露端口
|
||||||
EXPOSE 8000
|
EXPOSE 8000
|
||||||
|
|||||||
@ -686,6 +686,7 @@ async def get_user_orders(
|
|||||||
PointProductOrderDB.delivery_order_id == order.orderid
|
PointProductOrderDB.delivery_order_id == order.orderid
|
||||||
).all()
|
).all()
|
||||||
|
|
||||||
|
|
||||||
orders.append({
|
orders.append({
|
||||||
"orderid": order.orderid,
|
"orderid": order.orderid,
|
||||||
"userid": order.userid,
|
"userid": order.userid,
|
||||||
@ -902,6 +903,20 @@ async def deliveryman_orders(
|
|||||||
sub_orders = db.query(PointProductOrderDB).filter(
|
sub_orders = db.query(PointProductOrderDB).filter(
|
||||||
PointProductOrderDB.delivery_order_id == order.orderid
|
PointProductOrderDB.delivery_order_id == order.orderid
|
||||||
).all()
|
).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({
|
orders.append({
|
||||||
"orderid": order.orderid,
|
"orderid": order.orderid,
|
||||||
@ -913,6 +928,7 @@ async def deliveryman_orders(
|
|||||||
"pickup_images_count": order.pickup_images_count,
|
"pickup_images_count": order.pickup_images_count,
|
||||||
"create_time": order.create_time,
|
"create_time": order.create_time,
|
||||||
"delivery_method": order.delivery_method,
|
"delivery_method": order.delivery_method,
|
||||||
|
"delivery_time": delivery_time,
|
||||||
"original_amount": order.original_amount,
|
"original_amount": order.original_amount,
|
||||||
"coupon_discount_amount": order.coupon_discount_amount,
|
"coupon_discount_amount": order.coupon_discount_amount,
|
||||||
"point_discount_amount": order.point_discount_amount,
|
"point_discount_amount": order.point_discount_amount,
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user