fix(distribution): 货架加价打通前台、下单与卖方分成

分站公开列表和详情展示当前货架加价;下单写入 base_price / shelf_markup / markup_site_id 快照并计入实付。
支付分账改用快照加价,不再误用 PlatformFeeCent;结账不退加价,事后改价不影响历史订单。
This commit is contained in:
yml2213
2026-09-08 17:07:17 +08:00
parent 8521bf4753
commit 96bc6a4db6
16 changed files with 417 additions and 42 deletions
+12 -1
View File
@@ -290,8 +290,19 @@ func effectiveCheckoutDepositDeductCent(checkout model.OrderCheckout) int64 {
return maxCent(checkout.OtherAmountCent, 0)
}
func orderConsumptionPrepaidCent(order model.RentalOrder) int64 {
prepaid := order.RentAmountCent
if order.ShelfMarkupCent > 0 {
prepaid -= order.ShelfMarkupCent
if prepaid < 0 {
prepaid = 0
}
}
return prepaid
}
func calculateCheckoutSettlement(order model.RentalOrder, consumableAmountCent int64, coinConsumedM float64, depositDeductAmountCent int64) checkoutSettlement {
orderRentAmountCent := order.RentAmountCent
orderRentAmountCent := orderConsumptionPrepaidCent(order)
orderOwnerRentAmountCent := order.OwnerRentAmountCent
orderDepositAmountCent := order.DepositAmountCent