京东商场修改分类
This commit is contained in:
@@ -218,11 +218,16 @@ func updateOrCreateCategories(storeCat *dao.SkuStoreCatInfo, isCreate bool) (err
|
||||
if isCreate {
|
||||
createShopCategoryParam2.Type = jdshopapi.CreateCatType
|
||||
createShopCategoryParam2.ID = "1"
|
||||
createShopCategoryParams = append(createShopCategoryParams, createShopCategoryParam2)
|
||||
} else {
|
||||
createShopCategoryParam2.Type = jdshopapi.UpdateCatType
|
||||
createShopCategoryParam2.ID = storeCat.VendorCatID
|
||||
for _, v := range createShopCategoryParams {
|
||||
if v.ID == storeCat.VendorCatID {
|
||||
v = createShopCategoryParam2
|
||||
}
|
||||
}
|
||||
}
|
||||
createShopCategoryParams = append(createShopCategoryParams, createShopCategoryParam2)
|
||||
err = api.JdShopAPI.CreateShopCategory(createShopCategoryParams)
|
||||
return err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user