diff --git a/business/jxcallback/orderman/order.go b/business/jxcallback/orderman/order.go index 9cf88624d..475118c2d 100644 --- a/business/jxcallback/orderman/order.go +++ b/business/jxcallback/orderman/order.go @@ -287,13 +287,22 @@ func (c *OrderManager) updateOrderSkuOtherInfo(order *model.GoodsOrder, db *dao. } 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 } + + actStoreSkuList, err := dao.GetEffectiveActStoreSkuInfo(db, 0, nil, []int{jxStoreID}, jxutils.IntMap2List(skuIDMap), order.OrderCreatedAt, order.OrderCreatedAt) + if err != nil { + globals.SugarLogger.Errorf("updateOrderSkuOtherInfo can not get sku promotion info for error:%v", err) + return err + } + actStoreSkuMap = jxutils.NewActStoreSkuMap(actStoreSkuList, true) } + for _, v := range orderSkus { v.VendorOrderID = order.VendorOrderID v.VendorID = order.VendorID @@ -321,6 +330,12 @@ func (c *OrderManager) updateOrderSkuOtherInfo(order *model.GoodsOrder, db *dao. 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 + } + } } } } diff --git a/business/jxstore/cms/store_sku.go b/business/jxstore/cms/store_sku.go index 328c4d5fa..5bebe5e23 100644 --- a/business/jxstore/cms/store_sku.go +++ b/business/jxstore/cms/store_sku.go @@ -512,6 +512,8 @@ func updateActPrice4StoreSkuNameNew(db *dao.DaoDB, storeIDs, skuIDs []int, skuNa 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) } v.RealEarningPrice = v.EarningPrice diff --git a/controllers/promotion.go b/controllers/promotion.go index 0b8e3922d..4ab210f7d 100644 --- a/controllers/promotion.go +++ b/controllers/promotion.go @@ -4,7 +4,6 @@ import ( "fmt" "git.rosy.net.cn/jx-callback/business/jxutils" - "git.rosy.net.cn/jx-callback/business/model" "git.rosy.net.cn/jx-callback/globals" "github.com/astaxie/beego" @@ -41,8 +40,8 @@ type PromotionController struct { func (c *PromotionController) CreatePromotion() { c.callCreatePromotion(func(params *tPromotionCreatePromotionParams) (retVal interface{}, errCode string, err error) { if globals.EnableNewAct { - if params.VendorID == model.VendorIDJD { - return retVal, "", fmt.Errorf("请使用新版活动管理创建平台活动") + if true { //params.VendorID == model.VendorIDJD { + return retVal, "", fmt.Errorf("请使用新版活动管理创建活动") } } beginAt, err := utils.TryStr2Time(params.BeginAt)