This commit is contained in:
苏尹岚
2021-03-10 09:04:31 +08:00
parent 32a2c0498b
commit 0bad10fc85
2 changed files with 10 additions and 5 deletions

View File

@@ -269,12 +269,15 @@ func (a *API) ActivitySkuUpdateBatch(activityID int64, actSkuInfoList []*Activit
}
// 多渠道查询获取参与的活动IdList
func (a *API) ActMultiChannelQueryIDs(shopID string, baiduShopID int64, actType string) (err error) {
func (a *API) ActMultiChannelQueryIDs(shopID string, baiduShopID int64, actType string) (actIDs []int64, err error) {
params := a.genShopIDParams(shopID, baiduShopID, 0)
params["query_activity_type"] = actType
_, err = a.AccessAPI("act.multi.channel.queryids", params)
result, err := a.AccessAPI("act.multi.channel.queryids", params)
if err == nil {
return nil
for _, v := range result.Data.(map[string]interface{})["activityIdList"].([]interface{}) {
actIDs = append(actIDs, utils.MustInterface2Int64(v))
}
return actIDs, nil
}
return err
return actIDs, err
}

View File

@@ -95,8 +95,10 @@ func TestActivitySkuList(t *testing.T) {
}
func TestActMultiChannelQueryIDs(t *testing.T) {
err := api.ActMultiChannelQueryIDs("", 200000066556, "2")
result, err := api.ActMultiChannelQueryIDs("", 200000066556, "2")
if err != nil {
t.Fatal(err)
}
t.Log(utils.Format4Output(result, false))
}