- GetStoresSkus返回商品活动价格信息

This commit is contained in:
gazebo
2019-06-21 09:55:44 +08:00
parent 717b15cf90
commit 16cf42718a
4 changed files with 61 additions and 28 deletions

View File

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