From 89cb377026d400e237a262149fc55a93652522d4 Mon Sep 17 00:00:00 2001 From: aaron <> Date: Mon, 10 Mar 2025 11:03:54 +0800 Subject: [PATCH] update --- app/api/endpoints/order.py | 2 ++ app/api/endpoints/wechat.py | 8 ++++---- app/models/order.py | 4 ++++ 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/app/api/endpoints/order.py b/app/api/endpoints/order.py index a13bfbd..6e17cce 100644 --- a/app/api/endpoints/order.py +++ b/app/api/endpoints/order.py @@ -497,6 +497,7 @@ async def get_order_detail( "original_amount": order.original_amount, "coupon_discount_amount": order.coupon_discount_amount, "point_discount_amount": order.point_discount_amount, + "additional_fee_amount": order.additional_fee_amount, "coupon_id": order.coupon_id, "final_amount": order.final_amount, "deliveryman_share": order.delivery_share if order.delivery_share > 0 else calculate_delivery_share(order, current_user), @@ -506,6 +507,7 @@ async def get_order_detail( "is_first_order": order.is_first_order, "cancel_reason": order.cancel_reason, "order_additional_fee": order_additional_fee, + "pay_amount": order.pay_amount, "create_time": order.create_time, "complete_time": order.completed_time, diff --git a/app/api/endpoints/wechat.py b/app/api/endpoints/wechat.py index 4013152..4860401 100644 --- a/app/api/endpoints/wechat.py +++ b/app/api/endpoints/wechat.py @@ -148,8 +148,8 @@ async def create_payment( ).first() if not order: return error_response(code=404, message="订单不存在") - description = "配送费用" - amount = order.final_amount + description = "蜂快到家-配送费用" + amount = order.pay_amount elif order_prefix == "M": # 商家商品订单 order = db.query(MerchantOrderDB).filter( @@ -157,7 +157,7 @@ async def create_payment( ).first() if not order: return error_response(code=404, message="订单不存在") - description = "商品购买" + description = "蜂快到家-商品购买" amount = order.pay_amount elif order_prefix == "P": # 商家在线买单 @@ -166,7 +166,7 @@ async def create_payment( ).first() if not order: return error_response(code=404, message="订单不存在") - description = "在线买单" + description = "蜂快到家-在线买单" amount = order.amount else: diff --git a/app/models/order.py b/app/models/order.py index c0a03e8..b478bb7 100644 --- a/app/models/order.py +++ b/app/models/order.py @@ -108,6 +108,10 @@ class ShippingOrderDB(Base): @property def original_amount_with_additional_fee(self): return self.original_amount + self.additional_fee_amount + + @property + def pay_amount(self): + return self.final_amount + self.additional_fee_amount class ShippingOrderPackageDB(Base): __tablename__ = "shipping_order_packages"