diff --git a/business/model/dao/store_sku.go b/business/model/dao/store_sku.go index 27a976526..f93ea72db 100644 --- a/business/model/dao/store_sku.go +++ b/business/model/dao/store_sku.go @@ -1495,7 +1495,7 @@ func UpdateActPrice4StoreSkuNameNew(db *DaoDB, storeIDs, skuIDs []int, skuNamesI } if (actVendorID == -1 || actVendorID == model.VendorIDMTWM) && v.ActPrice == 0 { - if mtactMap != nil { + if len(mtactMap) > 0 { mtact := mtactMap[skuName.StoreID][v.SkuID] if mtact != nil { v.ActPrice = int(jxutils.StandardPrice2Int(mtact.ActPrice)) @@ -1507,20 +1507,21 @@ func UpdateActPrice4StoreSkuNameNew(db *DaoDB, storeIDs, skuIDs []int, skuNamesI } if actVendorMap[model.VendorIDMTWM] == nil { - if mtactMap != nil { - fmt.Println("1111111111111111111111", mtactMap) + if len(mtactMap) > 0 { mtact := mtactMap[skuName.StoreID][v.SkuID] - v.VendorActMaps = append(v.VendorActMaps, &VendorActMap{ - ActID: mtact.ItemID, - ActType: mtact.ActType, - ActPrice: int(jxutils.StandardPrice2Int(mtact.ActPrice)), - VendorID: model.VendorIDMTWM, - }) + if mtact != nil { + v.VendorActMaps = append(v.VendorActMaps, &VendorActMap{ + ActID: mtact.ItemID, + ActType: mtact.ActType, + ActPrice: int(jxutils.StandardPrice2Int(mtact.ActPrice)), + VendorID: model.VendorIDMTWM, + }) + } } } if (actVendorID == -1 || actVendorID == model.VendorIDEBAI) && v.ActPrice == 0 { - if ebaiactMap != nil { + if len(ebaiactMap) > 0 { ebaiact := ebaiactMap[skuName.StoreID][v.SkuID] if ebaiact != nil { v.ActPrice = int(jxutils.StandardPrice2Int(ebaiact.ActPrice)) @@ -1532,14 +1533,16 @@ func UpdateActPrice4StoreSkuNameNew(db *DaoDB, storeIDs, skuIDs []int, skuNamesI } if actVendorMap[model.VendorIDEBAI] == nil { - if ebaiactMap != nil { + if len(ebaiactMap) > 0 { ebaiact := ebaiactMap[skuName.StoreID][v.SkuID] - v.VendorActMaps = append(v.VendorActMaps, &VendorActMap{ - ActID: ebaiact.ActID, - ActType: model.ActSkuDirectDown, - ActPrice: int(jxutils.StandardPrice2Int(ebaiact.ActPrice)), - VendorID: model.VendorIDEBAI, - }) + if ebaiact != nil { + v.VendorActMaps = append(v.VendorActMaps, &VendorActMap{ + ActID: ebaiact.ActID, + ActType: model.ActSkuDirectDown, + ActPrice: int(jxutils.StandardPrice2Int(ebaiact.ActPrice)), + VendorID: model.VendorIDEBAI, + }) + } } }