平台价保留到毛,活动价不变

This commit is contained in:
苏尹岚
2020-02-19 16:46:01 +08:00
parent 798fdae0b3
commit 34903a3cd1
2 changed files with 12 additions and 2 deletions

View File

@@ -259,9 +259,19 @@ func ConstrainPricePercentage(percentage int) int {
return percentage
}
func CaculateSkuActVendorPrice(price, percentage, priceAdd int) (vendorPrice int) {
percentage = ConstrainPricePercentage(percentage)
vendorPrice = int(math.Round(float64(price*percentage)/100)) + priceAdd
if vendorPrice < 1 {
vendorPrice = 1
}
return vendorPrice
}
func CaculateSkuVendorPrice(price, percentage, priceAdd int) (vendorPrice int) {
percentage = ConstrainPricePercentage(percentage)
vendorPrice = int(math.Round(float64(price*percentage)/100)) + priceAdd
vendorPrice = int(math.Ceil(float64(vendorPrice)/10) * 10)
if vendorPrice < 1 {
vendorPrice = 1
}