This commit is contained in:
苏尹岚
2021-03-09 18:03:31 +08:00
parent ae08a80cd4
commit 32a2c0498b
7 changed files with 50 additions and 6 deletions

View File

@@ -26,6 +26,26 @@ const (
MaxActivityDescLength = 15 // 优惠描述限15个字符
)
var (
ActivityTypeList = []string{
"2", //:单品特价,
"8", //:品类满减,
"9", //:全店满减,
"10", //:新用户立减,
"11", //:运费满减,
"41", //:第N件特价,
"32", //:N选1商品活动,
"40", //:买N赠M商品活动,
"33", //:下单返券活动,
"34", //:M件X元或折,
"35", //:N元购,
"36", //:全店满减券(即商家代金券),
"37", //:商品满减券,
"38", //:跨seller商品满减券,
"39", //:跨seller运费券
}
)
type ActivityRule struct {
Accords int `json:"accords"` // 订单达到的金额,正整数,单位元。
Sale int `json:"sale"` // 每单减价额度,正整数,单位元。
@@ -247,3 +267,14 @@ func (a *API) ActivitySkuUpdateBatch(activityID int64, actSkuInfoList []*Activit
}
return nil, err
}
// 多渠道查询获取参与的活动IdList
func (a *API) ActMultiChannelQueryIDs(shopID string, baiduShopID int64, actType string) (err error) {
params := a.genShopIDParams(shopID, baiduShopID, 0)
params["query_activity_type"] = actType
_, err = a.AccessAPI("act.multi.channel.queryids", params)
if err == nil {
return nil
}
return err
}

View File

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

View File

@@ -243,7 +243,7 @@ func TestShopAptitudeUpload(t *testing.T) {
}
func TestShopDeliveryinfoGet(t *testing.T) {
result, err := api.ShopDeliveryinfoGet("", 32267315064)
result, err := api.ShopDeliveryinfoGet("", 100000115429)
if err != nil {
t.Fatal(err)
}