京东商场修改分类

This commit is contained in:
苏尹岚
2020-05-09 16:06:12 +08:00
parent 245408dedb
commit 5b18255c56

View File

@@ -218,11 +218,16 @@ func updateOrCreateCategories(storeCat *dao.SkuStoreCatInfo, isCreate bool) (err
if isCreate { if isCreate {
createShopCategoryParam2.Type = jdshopapi.CreateCatType createShopCategoryParam2.Type = jdshopapi.CreateCatType
createShopCategoryParam2.ID = "1" createShopCategoryParam2.ID = "1"
createShopCategoryParams = append(createShopCategoryParams, createShopCategoryParam2)
} else { } else {
createShopCategoryParam2.Type = jdshopapi.UpdateCatType createShopCategoryParam2.Type = jdshopapi.UpdateCatType
createShopCategoryParam2.ID = storeCat.VendorCatID createShopCategoryParam2.ID = storeCat.VendorCatID
for _, v := range createShopCategoryParams {
if v.ID == storeCat.VendorCatID {
v = createShopCategoryParam2
}
}
} }
createShopCategoryParams = append(createShopCategoryParams, createShopCategoryParam2)
err = api.JdShopAPI.CreateShopCategory(createShopCategoryParams) err = api.JdShopAPI.CreateShopCategory(createShopCategoryParams)
return err return err
} }