From 5b18255c56601af2efb15ef792c02e09354cb891 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8B=8F=E5=B0=B9=E5=B2=9A?= <770236076@qq.com> Date: Sat, 9 May 2020 16:06:12 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BA=AC=E4=B8=9C=E5=95=86=E5=9C=BA=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E5=88=86=E7=B1=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- business/partner/purchase/jdshop/store_sku.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/business/partner/purchase/jdshop/store_sku.go b/business/partner/purchase/jdshop/store_sku.go index a4dfd78ca..177f56c0e 100644 --- a/business/partner/purchase/jdshop/store_sku.go +++ b/business/partner/purchase/jdshop/store_sku.go @@ -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 }