This commit is contained in:
邹宗楠
2023-09-22 13:38:17 +08:00
parent 50406046ee
commit 5897e021c4

View File

@@ -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])
}