From 9bc5b083d8bcecd37fc403d60d2ea2b12a8f1ce5 Mon Sep 17 00:00:00 2001 From: gazebo Date: Fri, 9 Nov 2018 15:24:46 +0800 Subject: [PATCH] =?UTF-8?q?-=20trim=20=E6=9D=A5=E6=BA=90=20for=20jd=20prom?= =?UTF-8?q?otion?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- business/jxstore/promotion/jd_promotion.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/business/jxstore/promotion/jd_promotion.go b/business/jxstore/promotion/jd_promotion.go index d6abd0bdc..398acd1e3 100644 --- a/business/jxstore/promotion/jd_promotion.go +++ b/business/jxstore/promotion/jd_promotion.go @@ -4,6 +4,7 @@ import ( "encoding/gob" "errors" "fmt" + "strings" "time" "git.rosy.net.cn/baseapi/platformapi/jdapi" @@ -955,8 +956,9 @@ func createLocalPromotionFromRemote(promotionInfoId int64) (retVal *jdapi.Callba } // globals.SugarLogger.Debugf("jxStoreIDs:%s", utils.Format4Output(jxStoreIDs, false)) // globals.SugarLogger.Debugf("priceList:%s", utils.Format4Output(priceList, false)) + source := strings.Trim(result.Source, "来源") promotionParams := &PromotionParams{ - Name: result.Source + "-" + utils.Int64ToStr(result.PromotionInfoId), + Name: source + "-" + utils.Int64ToStr(result.PromotionInfoId), Advertising: "", Type: result.PromotionType, BeginAt: result.BeginTime, @@ -966,7 +968,7 @@ func createLocalPromotionFromRemote(promotionInfoId int64) (retVal *jdapi.Callba } mapData := map[string]interface{}{ keyPromotionStatus: jd2jxPromotionStatusMap[result.PromotionState], - keyPromotionSource: result.Source, + keyPromotionSource: source, } if skuResult != nil { mapData[keyLimitDaily] = skuResult.LimitDaily