- GetPricePercentage与GetPricePercentageByVendorPrice启用
This commit is contained in:
@@ -245,35 +245,35 @@ func CaculateSkuPriceFromVendor(vendorPrice, percentage, catPercentage int) int
|
|||||||
|
|
||||||
func GetPricePercentage(l model.PricePercentagePack, price int, defPricePercentage int) (pricePercentage int) {
|
func GetPricePercentage(l model.PricePercentagePack, price int, defPricePercentage int) (pricePercentage int) {
|
||||||
pricePercentage = defPricePercentage
|
pricePercentage = defPricePercentage
|
||||||
// if len(l) > 0 {
|
if len(l) > 0 {
|
||||||
// var lastItem *model.PricePercentageItem
|
var lastItem *model.PricePercentageItem
|
||||||
// for _, v := range l {
|
for _, v := range l {
|
||||||
// lastItem = v
|
lastItem = v
|
||||||
// if v.BeginPrice > price {
|
if v.BeginPrice > price {
|
||||||
// break
|
break
|
||||||
// }
|
}
|
||||||
// }
|
}
|
||||||
// if lastItem != nil {
|
if lastItem != nil {
|
||||||
// pricePercentage = lastItem.PricePercentage
|
pricePercentage = lastItem.PricePercentage
|
||||||
// }
|
}
|
||||||
// }
|
}
|
||||||
return pricePercentage
|
return pricePercentage
|
||||||
}
|
}
|
||||||
|
|
||||||
func GetPricePercentageByVendorPrice(l model.PricePercentagePack, vendorPrice int, defPricePercentage int) (pricePercentage int) {
|
func GetPricePercentageByVendorPrice(l model.PricePercentagePack, vendorPrice int, defPricePercentage int) (pricePercentage int) {
|
||||||
pricePercentage = defPricePercentage
|
pricePercentage = defPricePercentage
|
||||||
// if len(l) > 0 {
|
if len(l) > 0 {
|
||||||
// var lastItem *model.PricePercentageItem
|
var lastItem *model.PricePercentageItem
|
||||||
// for _, v := range l {
|
for _, v := range l {
|
||||||
// lastItem = v
|
lastItem = v
|
||||||
// if CaculateSkuVendorPrice(v.BeginPrice, v.PricePercentage, 0) > vendorPrice {
|
if CaculateSkuVendorPrice(v.BeginPrice, v.PricePercentage, 0) > vendorPrice {
|
||||||
// break
|
break
|
||||||
// }
|
}
|
||||||
// }
|
}
|
||||||
// if lastItem != nil {
|
if lastItem != nil {
|
||||||
// pricePercentage = lastItem.PricePercentage
|
pricePercentage = lastItem.PricePercentage
|
||||||
// }
|
}
|
||||||
// }
|
}
|
||||||
return pricePercentage
|
return pricePercentage
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user