- 修复GetPricePercentage的BUG

This commit is contained in:
gazebo
2019-07-18 11:54:05 +08:00
parent d0768e914b
commit c7736952b3
3 changed files with 6 additions and 6 deletions

View File

@@ -248,10 +248,10 @@ func GetPricePercentage(l model.PricePercentagePack, unitPrice int, defPricePerc
if len(l) > 0 {
var lastItem *model.PricePercentageItem
for _, v := range l {
lastItem = v
if v.BeginPrice > unitPrice {
break
}
lastItem = v
}
if lastItem != nil {
pricePercentage = lastItem.PricePercentage
@@ -265,10 +265,10 @@ func GetPricePercentageByVendorPrice(l model.PricePercentagePack, vendorPrice in
if len(l) > 0 {
var lastItem *model.PricePercentageItem
for _, v := range l {
lastItem = v
if CaculateSkuVendorPrice(v.BeginPrice, v.PricePercentage, 0) > vendorPrice {
break
}
lastItem = v
}
if lastItem != nil {
pricePercentage = lastItem.PricePercentage