From 9c36dc14173cddc0b7460d25b70c8d76ba5804ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8B=8F=E5=B0=B9=E5=B2=9A?= <770236076@qq.com> Date: Fri, 6 Nov 2020 15:01:56 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E8=80=81=E5=8C=85=E8=A3=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- business/jxstore/cms/store_sku.go | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/business/jxstore/cms/store_sku.go b/business/jxstore/cms/store_sku.go index 6707652c4..3101c12b2 100644 --- a/business/jxstore/cms/store_sku.go +++ b/business/jxstore/cms/store_sku.go @@ -56,6 +56,8 @@ const ( CopyStoreSkuModeFresh = "fresh" // 全新复制 CopyStoreSkuModeUpdate = "update" // 增量复制 CopyStoreSkuModeUpdatePrice = "updatePrice" // 增量复制价格 + + upcSpecName1 = "(新老包装随机发货)" ) //通用写入Excel @@ -4367,7 +4369,15 @@ func CreateSkusAndFocusFromWx(ctx *jxcontext.Context, productInfo *jdapi.Product } if len(skuNames) == 0 { if productInfo.Name == "" { - productInfo.Name = productInfo.OriginalName + var originName string + if strings.Contains(productInfo.OriginalName, upcSpecName1) { + originName = strings.ReplaceAll(productInfo.OriginalName, upcSpecName1, "") + } + _, name, _, specUnit, unit, specQuality := jxutils.SplitSkuName(originName) + productInfo.Name = name + productInfo.SpecQuality = specQuality + productInfo.Unit = unit + productInfo.SpecUnit = specUnit } skuNames2, err := dao.GetSkuNames(db, nil, nil, productInfo.Name, false) if err != nil {