update
This commit is contained in:
parent
71c114825a
commit
e0abc97a94
@ -61,6 +61,7 @@ async def create_merchant_order(
|
||||
|
||||
# 创建订单
|
||||
pay_amount = float(product.sale_price) * order.qty
|
||||
gift_points = pay_amount * float(product.gift_points_rate) / 100 * settings.POINT_RATIO
|
||||
db_order = MerchantOrderDB(
|
||||
order_id=order_id,
|
||||
user_id=current_user.userid,
|
||||
@ -71,7 +72,7 @@ async def create_merchant_order(
|
||||
address_id=order.address_id,
|
||||
order_amount=pay_amount,
|
||||
pay_amount=pay_amount,
|
||||
gift_points=int(float(product.sale_price) * (float(product.gift_points_rate) / 100) * settings.POINT_RATIO),
|
||||
gift_points=gift_points,
|
||||
status=MerchantOrderStatus.CREATED,
|
||||
order_verify_code=verify_code
|
||||
)
|
||||
@ -352,9 +353,12 @@ async def calculate_order_price(
|
||||
if not product:
|
||||
return error_response(code=404, message="商品不存在")
|
||||
|
||||
pay_amount = float(product.sale_price) * order.qty
|
||||
gift_points = pay_amount * float(product.gift_points_rate) / 100 * settings.POINT_RATIO
|
||||
|
||||
return success_response(data={
|
||||
"gift_points": int(float(product.sale_price) * (float(product.gift_points_rate) / 100) * settings.POINT_RATIO),
|
||||
"amount": product.sale_price
|
||||
"gift_points": int(gift_points),
|
||||
"amount": pay_amount
|
||||
})
|
||||
|
||||
|
||||
|
||||
BIN
jobs.sqlite
BIN
jobs.sqlite
Binary file not shown.
Loading…
Reference in New Issue
Block a user