This commit is contained in:
suyl
2021-08-18 15:04:08 +08:00
parent dbb0245e38
commit 0d9481df07

View File

@@ -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,
})
}
}
}