upodate
This commit is contained in:
parent
7dcf5e5375
commit
46d750d15f
@ -86,7 +86,7 @@ def calculate_price(price_request: OrderPriceCalculateRequest,user: UserDB,db: S
|
||||
coupon_discount_amount=0,
|
||||
points_discount_amount=0,
|
||||
original_amount=0,
|
||||
base_delivery_price=0,
|
||||
base_delivery_amount=0,
|
||||
more_station_price=0,
|
||||
final_amount=0
|
||||
)
|
||||
@ -109,8 +109,8 @@ def calculate_price(price_request: OrderPriceCalculateRequest,user: UserDB,db: S
|
||||
|
||||
# 是否有多驿站
|
||||
more_station_price = float(community.more_station_price) * (len(price_request.packages) - 1) if len(price_request.packages) > 1 else 0
|
||||
base_delivery_price = round(base_price + extra_package_price * max(0, package_count - extra_package_threshold), 2)
|
||||
original_amount = round(more_station_price + base_delivery_price, 2)
|
||||
base_delivery_amount = round(base_price + extra_package_price * max(0, package_count - extra_package_threshold), 2)
|
||||
original_amount = round(more_station_price + base_delivery_amount, 2)
|
||||
|
||||
result.price_info.package_count = package_count
|
||||
result.price_info.pickup_images_count = pickup_images_count
|
||||
@ -118,7 +118,7 @@ def calculate_price(price_request: OrderPriceCalculateRequest,user: UserDB,db: S
|
||||
result.price_info.original_amount = original_amount
|
||||
result.price_info.more_station_price = more_station_price
|
||||
result.price_info.final_amount = original_amount
|
||||
result.price_info.base_delivery_price = base_delivery_price
|
||||
result.price_info.base_delivery_amount = base_delivery_amount
|
||||
|
||||
remaining_amount = original_amount
|
||||
|
||||
@ -511,7 +511,7 @@ async def get_order_detail(
|
||||
"pickup_code_count": order.pickup_code_count,
|
||||
"pickup_images_count": order.pickup_images_count,
|
||||
"original_amount": order.original_amount,
|
||||
"base_delivery_price": order.original_amount - order.more_station_price,
|
||||
"base_delivery_amount": order.original_amount - order.more_station_price,
|
||||
"coupon_discount_amount": order.coupon_discount_amount,
|
||||
"point_discount_amount": order.point_discount_amount,
|
||||
"more_station_price": order.more_station_price,
|
||||
|
||||
@ -223,7 +223,7 @@ class OrderPriceInfo(BaseModel):
|
||||
coupon_discount_amount: float = 0
|
||||
points_discount_amount: float = 0
|
||||
more_station_price: float = 0
|
||||
base_delivery_price: float = 0
|
||||
base_delivery_amount: float = 0
|
||||
coupon_id: Optional[int] = None
|
||||
final_amount: float = 0
|
||||
|
||||
|
||||
BIN
jobs.sqlite
BIN
jobs.sqlite
Binary file not shown.
Loading…
Reference in New Issue
Block a user