- GetOrderSkuInfo返回RealEarningPrice代表单品实际结给商家的钱

This commit is contained in:
gazebo
2019-06-20 10:05:35 +08:00
parent faca22c993
commit 8a707df773
4 changed files with 77 additions and 99 deletions

View File

@@ -369,14 +369,7 @@ func caculateOrderEarningPrice(order *model.GoodsOrder, storePayPercentage int)
for _, v := range order.Skus {
skuEarningPrice := v.EarningPrice
if skuEarningPrice == 0 {
basePrice := v.SalePrice
if v.ShopPrice > 0 && v.ShopPrice < basePrice {
basePrice = v.ShopPrice
}
if storePayPercentage <= 0 {
storePayPercentage = model.DefaultEarningPricePercentage
}
skuEarningPrice = basePrice * int64(storePayPercentage) / 100
skuEarningPrice = jxutils.CaculateSkuEarningPrice(v.ShopPrice, v.SalePrice, storePayPercentage)
}
order.EarningPrice += skuEarningPrice
}