diff --git a/platformapi/jdshopapi/store_page.go b/platformapi/jdshopapi/store_page.go index 4e6f08d2..f1b5f2a0 100644 --- a/platformapi/jdshopapi/store_page.go +++ b/platformapi/jdshopapi/store_page.go @@ -1065,14 +1065,10 @@ func (a *API) StoreUpdateStock(stockNum int, skuId int64, vendorStoreID string) } //门店关注商品 -func (a *API) StoreSkuBindStore(allStore bool, skuId int64, vendorStoreID string) (err error) { - var storeIDs []string - if vendorStoreID != "" { - storeIDs = append(storeIDs, vendorStoreID) - } +func (a *API) StoreSkuBindStore(allStore bool, skuIds, vendorStoreIDs []string) (err error) { params := map[string]interface{}{ - "skuIds": []string{utils.Int64ToStr(skuId)}, - "storeIds": storeIDs, + "skuIds": skuIds, + "storeIds": vendorStoreIDs, "allStore": allStore, } _, err = a.AccessStorePage2("https://ware.shop.jd.com/rest/storeProduct/skuBindStore", params, true) diff --git a/platformapi/jdshopapi/store_page_test.go b/platformapi/jdshopapi/store_page_test.go index e17b1445..5f4769c9 100644 --- a/platformapi/jdshopapi/store_page_test.go +++ b/platformapi/jdshopapi/store_page_test.go @@ -310,7 +310,7 @@ func TestStoreUpdateStock(t *testing.T) { } func TestStoreSkuBindStore(t *testing.T) { - err := api.StoreSkuBindStore(false, 10024685331653, "1000063128") + err := api.StoreSkuBindStore(false, []string{"10024685331653"}, []string{"1000063128"}) if err != nil { t.Fatal(err) }