- 修复NewActStoreSkuMap中的BUG

This commit is contained in:
gazebo
2019-07-25 20:39:56 +08:00
parent 382d8ac836
commit b0e4cb04ae

View File

@@ -14,9 +14,8 @@ func NewActStoreSkuMap(actStoreSkuList []*model.ActStoreSku2, isActPrice bool) (
if actStoreSkuMap[index] == nil {
actStoreSkuMap[index] = make(map[int]*model.ActStoreSku2)
}
if actStoreSkuMap[index][v.VendorID] == nil ||
(isActPrice && actStoreSkuMap[index][v.VendorID].ActualActPrice > v.ActualActPrice && v.ActualActPrice > 0) ||
(!isActPrice && actStoreSkuMap[index][v.VendorID].EarningPrice > v.EarningPrice && v.EarningPrice > 0) {
if (isActPrice && v.ActualActPrice > 0 && (actStoreSkuMap[index][v.VendorID] == nil || actStoreSkuMap[index][v.VendorID].ActualActPrice > v.ActualActPrice)) ||
(!isActPrice && v.EarningPrice > 0 && (actStoreSkuMap[index][v.VendorID] == nil || actStoreSkuMap[index][v.VendorID].EarningPrice > v.EarningPrice)) {
actStoreSkuMap[index][v.VendorID] = v
}
}