- 去掉对于GetPromotionSkuPriceMap的使用

This commit is contained in:
gazebo
2019-07-25 17:21:59 +08:00
parent 83e7af3ba2
commit f21666e6bd
2 changed files with 25 additions and 23 deletions

View File

@@ -489,11 +489,11 @@ func GetStoreAndSkuIDsFromInfo(skuNamesInfo *StoreSkuNamesInfo) (storeIDs, skuID
// }
func updateActPrice4StoreSkuNameNew(db *dao.DaoDB, storeIDs, skuIDs []int, skuNamesInfo *StoreSkuNamesInfo) (err error) {
jxSkuPriceMap, err := dao.GetPromotionSkuPriceMap(db, model.VendorIDJX, storeIDs, skuIDs, time.Now(), time.Now())
if err != nil {
globals.SugarLogger.Errorf("updateActPrice4StoreSkuNameNew can not get sku promotion info for error:%v", err)
return err
}
// jxSkuPriceMap, err := dao.GetPromotionSkuPriceMap(db, model.VendorIDJX, storeIDs, skuIDs, time.Now(), time.Now())
// if err != nil {
// globals.SugarLogger.Errorf("updateActPrice4StoreSkuNameNew can not get sku promotion info for error:%v", err)
// return err
// }
actStoreSkuList, err := dao.GetEffectiveActStoreSkuInfo(db, 0, nil, storeIDs, skuIDs, time.Now(), time.Now())
if err != nil {
@@ -509,10 +509,11 @@ func updateActPrice4StoreSkuNameNew(db *dao.DaoDB, storeIDs, skuIDs []int, skuNa
if actStoreSku != nil {
v.ActPrice = int(actStoreSku.ActualActPrice)
}
index := dao.GenSkuPriceMapKey(skuName.StoreID, v.SkuID)
if jxSkuPriceMap[index] != nil {
v.EarningPrice = jxSkuPriceMap[index].EarningPrice
} else if actStoreSku != nil {
// index := dao.GenSkuPriceMapKey(skuName.StoreID, v.SkuID)
// if jxSkuPriceMap[index] != nil {
// v.EarningPrice = jxSkuPriceMap[index].EarningPrice
// } else
if actStoreSku != nil {
v.EarningPrice = int(actStoreSku.EarningPrice)
}