This commit is contained in:
suyl
2021-08-14 10:17:56 +08:00
parent cc429e785d
commit 5ef56867a0
2 changed files with 40 additions and 0 deletions

View File

@@ -1445,6 +1445,15 @@ func UpdateActPrice4StoreSkuNameNew(db *DaoDB, storeIDs, skuIDs []int, skuNamesI
}
mtactMap[v.StoreID][v.SkuID] = v
}
ebaiactList, _ := GetActEbaiVendorSkus(db, storeIDs, skuIDs)
ebaiactMap := make(map[int]map[int]*model.ActEbaiVendorSku)
for _, v := range ebaiactList {
if ebaiactMap[v.StoreID] == nil {
ebaiactskuMap := make(map[int]*model.ActEbaiVendorSku)
ebaiactMap[v.StoreID] = ebaiactskuMap
}
ebaiactMap[v.StoreID][v.SkuID] = v
}
for _, skuName := range skuNamesInfo.SkuNames {
if len(skuName.Skus) > 0 {
for _, v := range skuName.Skus {
@@ -1481,6 +1490,18 @@ func UpdateActPrice4StoreSkuNameNew(db *DaoDB, storeIDs, skuIDs []int, skuNamesI
}
}
if (actVendorID == -1 || actVendorID == model.VendorIDEBAI) && v.ActPrice == 0 {
if ebaiactMap != nil {
ebaiact := ebaiactMap[skuName.StoreID][v.SkuID]
if ebaiact != nil {
v.ActPrice = int(jxutils.StandardPrice2Int(ebaiact.ActPrice))
v.ActType = model.ActSkuDirectDown
v.ActID = int(utils.Str2Int64(ebaiact.ActID) % 1000)
v.EarningPrice = 0
}
}
}
if globals.IsStoreSkuAct {
v.VendorInfoMap = make(map[int]*StoreSkuVendorInfo)
for _, storeMap := range storeMapMap[skuName.StoreID] {