- updateActPrice4StoreSkuNameNew中对于活动与结算价,准确处理
This commit is contained in:
@@ -503,20 +503,16 @@ func updateActPrice4StoreSkuNameNew(db *dao.DaoDB, storeIDs, skuIDs []int, skuNa
|
|||||||
globals.SugarLogger.Errorf("updateActPrice4StoreSkuNameNew can not get sku promotion info for error:%v", err)
|
globals.SugarLogger.Errorf("updateActPrice4StoreSkuNameNew can not get sku promotion info for error:%v", err)
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
actStoreSkuMap := jxutils.NewActStoreSkuMap(actStoreSkuList, true)
|
actStoreSkuMap4Act := jxutils.NewActStoreSkuMap(actStoreSkuList, true)
|
||||||
|
actStoreSkuMap4EarningPrice := jxutils.NewActStoreSkuMap(actStoreSkuList, false)
|
||||||
|
|
||||||
for _, skuName := range skuNamesInfo.SkuNames {
|
for _, skuName := range skuNamesInfo.SkuNames {
|
||||||
if len(skuName.Skus2) > 0 {
|
if len(skuName.Skus2) > 0 {
|
||||||
for _, v := range skuName.Skus2 {
|
for _, v := range skuName.Skus2 {
|
||||||
actStoreSku := actStoreSkuMap.GetActStoreSku(skuName.StoreID, v.SkuID, -1)
|
if actStoreSku := actStoreSkuMap4Act.GetActStoreSku(skuName.StoreID, v.SkuID, -1); actStoreSku != nil {
|
||||||
if actStoreSku != nil {
|
|
||||||
v.ActPrice = int(actStoreSku.ActualActPrice)
|
v.ActPrice = int(actStoreSku.ActualActPrice)
|
||||||
}
|
}
|
||||||
// index := dao.GenSkuPriceMapKey(skuName.StoreID, v.SkuID)
|
if actStoreSku := actStoreSkuMap4EarningPrice.GetActStoreSku(skuName.StoreID, v.SkuID, -1); actStoreSku != nil {
|
||||||
// if jxSkuPriceMap[index] != nil {
|
|
||||||
// v.EarningPrice = jxSkuPriceMap[index].EarningPrice
|
|
||||||
// } else
|
|
||||||
if actStoreSku != nil {
|
|
||||||
v.EarningPrice = int(actStoreSku.EarningPrice)
|
v.EarningPrice = int(actStoreSku.EarningPrice)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user