From 690453cd7394305eaa126d6cc9b753dc191b91ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8B=8F=E5=B0=B9=E5=B2=9A?= <770236076@qq.com> Date: Thu, 12 Dec 2019 16:25:27 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A0=B9=E6=8D=AEExcel=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=E4=BA=AC=E8=A5=BF=E4=BB=B7=EF=BC=8C=E4=BF=AE=E6=94=B9=E5=BC=82?= =?UTF-8?q?=E6=AD=A5=E4=BB=BB=E5=8A=A1=E4=B8=AD=E8=BF=94=E5=9B=9E=E5=80=BC?= 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, 8 insertions(+), 4 deletions(-) diff --git a/business/jxstore/cms/store_sku.go b/business/jxstore/cms/store_sku.go index 8e4ca1062..78e8eb85f 100644 --- a/business/jxstore/cms/store_sku.go +++ b/business/jxstore/cms/store_sku.go @@ -2097,10 +2097,10 @@ func ReCalculateJxPrice(db *dao.DaoDB, ctx *jxcontext.Context, storeIDs []int) ( dao.UpdateEntity(db, skuBind) } } else { - return "", err + return nil, err } } else { - return "", err + return nil, err } return retVal, err }, storeIDs) @@ -2237,8 +2237,12 @@ func RefreshJxPriceByExcelBin(ctx *jxcontext.Context, storeIDs []int, reader io. err = err2 if len(skuList) > 0 { unitPrice := 0 - if storeSkuNamePrice.Unit == "KG" { - unitPrice = storeSkuNamePrice.Price / 2 + if skuList[0].Unit == model.UnitNames[0] { + if storeSkuNamePrice.Unit == "KG" { + unitPrice = storeSkuNamePrice.Price / 2 + } else { + unitPrice = storeSkuNamePrice.Price + } } else { unitPrice = storeSkuNamePrice.Price }