From 5897e021c43b7ae9d273c0c0d0a0cf5c3f056759 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B9=E5=AE=97=E6=A5=A0?= Date: Fri, 22 Sep 2023 13:38:17 +0800 Subject: [PATCH] 1 --- business/jxstore/cms/system_store_sku.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/business/jxstore/cms/system_store_sku.go b/business/jxstore/cms/system_store_sku.go index 97dabda92..3b11f94e7 100644 --- a/business/jxstore/cms/system_store_sku.go +++ b/business/jxstore/cms/system_store_sku.go @@ -156,6 +156,7 @@ type Skus struct { // BatchInitData 批量创建商品 func BatchInitData(ctx *jxcontext.Context, fromSku []*mtwmapi.AppFood, toApi *mtwmapi.API, vendorStoreID string) error { + globals.SugarLogger.Debugf("=") foodDataList := make([]map[string]interface{}, len(fromSku)) for i, storeSku := range fromSku { foodData := make(map[string]interface{}) @@ -167,8 +168,8 @@ func BatchInitData(ctx *jxcontext.Context, fromSku []*mtwmapi.AppFood, toApi *mt } skus2 := make([]*Skus, 0, 0) for i2 := 0; i2 < len(skus); i2++ { - if skus[i].Weight != "" && skus[i].WeightForUnit != "" { - skus[i].WeightForUnit = "" + if skus[i2].Weight != "" && skus[i2].WeightForUnit != "" { + skus[i2].WeightForUnit = "" } skus2 = append(skus2, skus2[i2]) }