From 9d01bddc6575c4d45ebe2d75a6c10282c397f66a Mon Sep 17 00:00:00 2001 From: gazebo Date: Fri, 21 Jun 2019 10:32:20 +0800 Subject: [PATCH] =?UTF-8?q?-=20GetPromotionSkuPriceMap=E4=B8=8D=E4=B8=8EEa?= =?UTF-8?q?rningPrice=E7=9B=B8=E5=85=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- business/jxcallback/orderman/order.go | 2 +- business/model/dao/promotion.go | 8 +++----- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/business/jxcallback/orderman/order.go b/business/jxcallback/orderman/order.go index aa834c5ec..1c9f3b35d 100644 --- a/business/jxcallback/orderman/order.go +++ b/business/jxcallback/orderman/order.go @@ -317,7 +317,7 @@ 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 { + if skuPriceMap[index] != nil && skuPriceMap[index].EarningPrice > 0 { v.EarningPrice = int64(skuPriceMap[index].EarningPrice) } } diff --git a/business/model/dao/promotion.go b/business/model/dao/promotion.go index ddfd9783b..8c5fb0d70 100644 --- a/business/model/dao/promotion.go +++ b/business/model/dao/promotion.go @@ -50,11 +50,9 @@ func GetPromotionSkuPriceMap(db *DaoDB, vendorID int, storeIDs, skuIDs []int, fr } skuPriceMap = make(map[int64]*PromotionStoreSku) for _, v := range skuPriceList { - if v.EarningPrice > 0 { - index := GenSkuPriceMapKey(v.StoreID, v.SkuID) - if skuPriceMap[index] == nil || v.EarningPrice < skuPriceMap[index].EarningPrice { - skuPriceMap[index] = v - } + index := GenSkuPriceMapKey(v.StoreID, v.SkuID) + if true /*skuPriceMap[index] == nil || v.EarningPrice < skuPriceMap[index].EarningPrice*/ { + skuPriceMap[index] = v } } return skuPriceMap, err