- up
This commit is contained in:
@@ -14,22 +14,18 @@ const (
|
||||
PageActivityTypeSkuDirectDown = 2 // 商品直降
|
||||
)
|
||||
|
||||
const (
|
||||
maxPageSize4ActSkuList = 100
|
||||
)
|
||||
|
||||
type PageActItem struct {
|
||||
ActivityID string `json:"activity_id"`
|
||||
ActivityName string `json:"activity_name"`
|
||||
ActivityType string `json:"activity_type"`
|
||||
ActivityType int `json:"activity_type"`
|
||||
ActivityPlatform string `json:"activity_platform"`
|
||||
StartTime string `json:"start_time"`
|
||||
EndTime string `json:"end_time"`
|
||||
StartTime int64 `json:"start_time"`
|
||||
EndTime int64 `json:"end_time"`
|
||||
User string `json:"user"`
|
||||
Status string `json:"status"`
|
||||
StopTime string `json:"stop_time"`
|
||||
CreatorType string `json:"creator_type"`
|
||||
CreateTime int `json:"create_time"`
|
||||
Status int `json:"status"`
|
||||
StopTime int64 `json:"stop_time"`
|
||||
CreatorType int `json:"creator_type"`
|
||||
CreateTime int64 `json:"create_time"`
|
||||
ChildType string `json:"child_type"`
|
||||
CreatedAt string `json:"created_at"`
|
||||
ShopNum int `json:"shop_num,omitempty"`
|
||||
@@ -49,10 +45,10 @@ type PageActListInfo struct {
|
||||
type PageActSku struct {
|
||||
ID string `json:"id"`
|
||||
ActivityID string `json:"activity_id"`
|
||||
ActivityType string `json:"activity_type"`
|
||||
ActivityType int `json:"activity_type"`
|
||||
SkuID string `json:"sku_id"`
|
||||
SupplierID string `json:"supplier_id"`
|
||||
Wid string `json:"wid"`
|
||||
SupplierID int `json:"supplier_id"`
|
||||
Wid int64 `json:"wid"`
|
||||
ShopName string `json:"shop_name"`
|
||||
UpcID string `json:"upc_id"`
|
||||
Upc string `json:"upc"`
|
||||
@@ -62,10 +58,10 @@ type PageActSku struct {
|
||||
FreeSkuName string `json:"free_sku_name"`
|
||||
PlatformSubsidy string `json:"platform_subsidy"`
|
||||
ShopSubsidy string `json:"shop_subsidy"`
|
||||
Stock string `json:"stock"`
|
||||
Status string `json:"status"`
|
||||
CreateTime string `json:"create_time"`
|
||||
UpdateTime string `json:"update_time"`
|
||||
Stock int `json:"stock"`
|
||||
Status int `json:"status"`
|
||||
CreateTime int64 `json:"create_time"`
|
||||
UpdateTime int64 `json:"update_time"`
|
||||
RejectReason string `json:"reject_reason"`
|
||||
SupplierName string `json:"supplier_name"`
|
||||
IsRecruit string `json:"is_recruit"`
|
||||
@@ -85,15 +81,20 @@ type PageActivityInfo struct {
|
||||
Perpage int `json:"perpage"`
|
||||
}
|
||||
|
||||
func (a *API) BegetActivityList(supplierID int64, showStatus, activityType int) (actList []*PageActItem, err error) {
|
||||
pageSize := maxPageSize4ActSkuList
|
||||
func (a *API) BegetActivityList(showStatus, activityType int, baiduShopID, supplierID int64) (actList []*PageActItem, err error) {
|
||||
pageSize := 20
|
||||
pageNo := 1
|
||||
params := map[string]interface{}{
|
||||
"perpage": pageSize,
|
||||
"supplier_id": supplierID,
|
||||
"show_status": showStatus,
|
||||
"activity_type": activityType, //不设置这个值,缺省为:PageActivityTypeSkuDirectDown
|
||||
}
|
||||
if baiduShopID > 0 {
|
||||
params["wid"] = baiduShopID
|
||||
}
|
||||
if supplierID > 0 {
|
||||
params[KeySupplierID] = supplierID
|
||||
}
|
||||
for {
|
||||
params["curpage"] = pageNo
|
||||
retVal, err2 := a.AccessStorePage("commodity/activity/begetactivitylist", params, false)
|
||||
@@ -116,14 +117,19 @@ func (a *API) BegetActivityList(supplierID int64, showStatus, activityType int)
|
||||
return nil, err
|
||||
}
|
||||
|
||||
func (a *API) BegetActSkuList(activityID, supplierID int64) (actSkuList []*PageActSku, err error) {
|
||||
pageSize := maxPageSize4ActSkuList
|
||||
func (a *API) BegetActSkuList(activityID, baiduShopID, supplierID int64) (actSkuList []*PageActSku, err error) {
|
||||
pageSize := 100
|
||||
pageNo := 1
|
||||
params := map[string]interface{}{
|
||||
"perpage": pageSize,
|
||||
"supplier_id": supplierID,
|
||||
"activity_id": activityID,
|
||||
}
|
||||
if baiduShopID > 0 {
|
||||
params["wid"] = baiduShopID
|
||||
}
|
||||
if supplierID > 0 {
|
||||
params[KeySupplierID] = supplierID
|
||||
}
|
||||
for {
|
||||
params["curpage"] = pageNo
|
||||
retVal, err2 := a.AccessStorePage("commodity/activity/begetactskulist", params, false)
|
||||
|
||||
Reference in New Issue
Block a user