From 019aff1f089ee4c76dfc91ee8240e137c5e532ed 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, 30 Jul 2020 10:25:19 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=9B=E5=BB=BA=E8=A7=84=E6=A0=BC=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- business/partner/purchase/jdshop/store_sku.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/business/partner/purchase/jdshop/store_sku.go b/business/partner/purchase/jdshop/store_sku.go index 911648a78..42b31b0ca 100644 --- a/business/partner/purchase/jdshop/store_sku.go +++ b/business/partner/purchase/jdshop/store_sku.go @@ -2,6 +2,7 @@ package jdshop import ( "fmt" + "math" "regexp" "strings" "time" @@ -834,7 +835,11 @@ func buildUpdateSkusParam(storeSku *dao.StoreSkuSyncInfo, v *dao.StoreSkuSyncInf } sku.MultiCateProps = multiPropSku if v.SpecUnit == model.SpecUnitNames[1] || v.SpecUnit == model.SpecUnitNames[2] { - specQuality = strings.TrimRight(fmt.Sprintf("%.2f", float64(v.SpecQuality)), "0.") + v.SpecUnit + if math.Mod(float64(v.SpecQuality), 10) != 0 { + specQuality = strings.TrimRight(fmt.Sprintf("%.2f", float64(v.SpecQuality)), "0.") + v.SpecUnit + } else { + specQuality = utils.Float64ToStr(float64(v.SpecQuality)) + v.SpecUnit + } } else { specQuality = utils.Float64ToStr(float64(v.SpecQuality)) + v.SpecUnit }