- 去掉对于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

@@ -286,14 +286,14 @@ func (c *OrderManager) updateOrderSkuOtherInfo(order *model.GoodsOrder, db *dao.
skumapper[v.VendorSkuID] = v
}
var skuPriceMap map[int64]*dao.PromotionStoreSku
// var skuPriceMap map[int64]*dao.PromotionStoreSku
var actStoreSkuMap *jxutils.ActStoreSkuMap
if len(skuIDMap) > 0 {
skuPriceMap, err = dao.GetPromotionSkuPriceMap(db, model.VendorIDJX, []int{jxStoreID}, jxutils.IntMap2List(skuIDMap), order.OrderCreatedAt, order.OrderCreatedAt)
if err != nil {
globals.SugarLogger.Errorf("updateOrderSkuOtherInfo can not get sku promotion info for orderID:%s, error:%v", order.VendorOrderID, err)
return err
}
// skuPriceMap, err = dao.GetPromotionSkuPriceMap(db, model.VendorIDJX, []int{jxStoreID}, jxutils.IntMap2List(skuIDMap), order.OrderCreatedAt, order.OrderCreatedAt)
// if err != nil {
// globals.SugarLogger.Errorf("updateOrderSkuOtherInfo can not get sku promotion info for orderID:%s, error:%v", order.VendorOrderID, err)
// return err
// }
actStoreSkuList, err := dao.GetEffectiveActStoreSkuInfo(db, 0, []int{order.VendorID}, []int{jxStoreID}, jxutils.IntMap2List(skuIDMap), order.OrderCreatedAt, order.OrderCreatedAt)
if err != nil {
@@ -323,14 +323,15 @@ func (c *OrderManager) updateOrderSkuOtherInfo(order *model.GoodsOrder, db *dao.
}
}
if skuPriceMap != nil {
if skuID := jxutils.GetSkuIDFromOrderSku(v); skuID > 0 /*&& v.StoreSubName != ""*/ {
index := dao.GenSkuPriceMapKey(jxStoreID, v.SkuID)
if skuPriceMap[index] != nil && skuPriceMap[index].EarningPrice > 0 {
v.EarningPrice = int64(skuPriceMap[index].EarningPrice)
}
}
} else if actStoreSkuMap != nil {
// if skuPriceMap != nil {
// if skuID := jxutils.GetSkuIDFromOrderSku(v); skuID > 0 /*&& v.StoreSubName != ""*/ {
// index := dao.GenSkuPriceMapKey(jxStoreID, v.SkuID)
// if skuPriceMap[index] != nil && skuPriceMap[index].EarningPrice > 0 {
// v.EarningPrice = int64(skuPriceMap[index].EarningPrice)
// }
// }
// } else
if actStoreSkuMap != nil {
if skuID := jxutils.GetSkuIDFromOrderSku(v); skuID > 0 /*&& v.StoreSubName != ""*/ {
if actStoreSku := actStoreSkuMap.GetActStoreSku(jxStoreID, skuID, order.VendorID); actStoreSku != nil {
v.EarningPrice = actStoreSku.EarningPrice