直营店始终按比例结算,不考虑活动与结算表

This commit is contained in:
gazebo
2019-11-26 08:58:49 +08:00
parent 01b11e0a55
commit 22f60a4546
2 changed files with 8 additions and 3 deletions

View File

@@ -372,9 +372,14 @@ func (c *OrderManager) updateOrderSkuOtherInfo(order *model.GoodsOrder, db *dao.
}
}
}
v.EarningPrice = jxutils.CaculateSkuEarningPrice(v.ShopPrice, v.SalePrice, storePayPercentage)
// 直营店始终按比例结算,不考虑活动与结算表
salePrice := v.SalePrice
if changePriceType == model.StoreChangePriceTypeManagedStore && v.ShopPrice != 0 {
salePrice = 0
}
v.EarningPrice = jxutils.CaculateSkuEarningPrice(v.ShopPrice, salePrice, storePayPercentage)
}
// 直营店始终按比例结算
// 直营店始终按比例结算,不考虑活动与结算表
if changePriceType != model.StoreChangePriceTypeManagedStore {
updateSingleOrderEarningPrice(order, db)
}

View File

@@ -466,7 +466,7 @@ func GetVendorName(vendorID int) (vendorName string) {
func CaculateSkuEarningPrice(shopPrice, salePrice int64, storePayPercentage int) (earningPrice int64) {
earningPrice = salePrice
if shopPrice > 0 && shopPrice < earningPrice {
if salePrice == 0 || shopPrice > 0 && shopPrice < earningPrice {
earningPrice = shopPrice
}
if storePayPercentage <= 0 {