diff --git a/business/jxstore/cms/store_sku.go b/business/jxstore/cms/store_sku.go index 429292f7b..61f5c5c3d 100644 --- a/business/jxstore/cms/store_sku.go +++ b/business/jxstore/cms/store_sku.go @@ -6589,7 +6589,7 @@ func CopyMtToJd(ctx *jxcontext.Context, mtStoreID, mtOrgCode, jdStoreID, jdOrgCo for _, jdc := range jdCatList { for _, mtc := range catList { if jdc.Name == mtc.Name { - catMap[mtc.Code] = utils.Int64ToStr(jdc.Id) + catMap[mtc.Name] = utils.Int64ToStr(jdc.Id) } } } @@ -6650,15 +6650,21 @@ func CopyMtToJd(ctx *jxcontext.Context, mtStoreID, mtOrgCode, jdStoreID, jdOrgCo param.OutSkuID = fmt.Sprintf("%d_%d", time.Now().Unix(), param.SkuPrice) } vendorCategoryId, _ := handler.GetSkuCategoryIdByName(jdOrgCode, mtSku.Name) - if vendorCategoryId != "" { + if vendorCategoryId != "" && utils.Str2Int64(vendorCategoryId) <= 25048 { param.CategoryID = utils.Str2Int64(vendorCategoryId) // 其他水果 } else if utils.Str2Int64(vendorCategoryId) > 25048 { // 只有水果,後面刪除 param.CategoryID = 22410 // 其他水果 } - if mtSku.SecondaryCategoryCode != "" { - param.ShopCategories = append(param.ShopCategories, utils.Str2Int64(catMap[mtSku.SecondaryCategoryCode])) - } else if mtSku.CategoryCode != "" { - param.ShopCategories = append(param.ShopCategories, utils.Str2Int64(catMap[mtSku.CategoryCode])) + + //if mtSku.SecondaryCategoryCode != "" { + // param.ShopCategories = append(param.ShopCategories, utils.Str2Int64(catMap[mtSku.SecondaryCategoryCode])) + //} else if mtSku.CategoryCode != "" { + // param.ShopCategories = append(param.ShopCategories, utils.Str2Int64(catMap[mtSku.CategoryCode])) + //} else { + // param.ShopCategories = append(param.ShopCategories, 33313305) // 暂无分类 + //} + if mtSku.CategoryName != "" { + param.ShopCategories = append(param.ShopCategories, utils.Str2Int64(catMap[mtSku.CategoryName])) } else { param.ShopCategories = append(param.ShopCategories, 33313305) // 暂无分类 }