From be0bcf63f40dcccc28c404b5f69f4b70b3d4e7d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8B=8F=E5=B0=B9=E5=B2=9A?= <770236076@qq.com> Date: Mon, 16 Dec 2019 16:52:34 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A0=B9=E6=8D=AE=E5=90=8D=E5=AD=97=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2=E4=BA=AC=E4=B8=9Cupc?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- business/jxstore/cms/sku.go | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/business/jxstore/cms/sku.go b/business/jxstore/cms/sku.go index 0184f9067..504424677 100644 --- a/business/jxstore/cms/sku.go +++ b/business/jxstore/cms/sku.go @@ -1315,15 +1315,11 @@ func GetJdUpcCodeByName(ctx *jxcontext.Context, name, upcCode string) (productIn if err != nil { return retVal, err } - if len(productInfo) > 0 { - for _, v := range productInfo { - productInfo2, _ := api.ShowAPI.GetProductInfoByBarCode(v.UpcCode) - if productInfo2 != nil { - v.Name = productInfo2.Name - v.SpecQuality = productInfo2.SpecQuality - v.SpecUnit = productInfo2.SpecUnit - } - } + for _, v := range productInfo { + _, name, _, specUnit, _, specQuality := jxutils.SplitSkuName(v.OriginalName) + v.Name = name + v.SpecQuality = specQuality + v.SpecUnit = specUnit } retVal = productInfo return retVal, err