diff --git a/business/jxstore/cms/cms.go b/business/jxstore/cms/cms.go index 3f361e09b..b5260e296 100644 --- a/business/jxstore/cms/cms.go +++ b/business/jxstore/cms/cms.go @@ -105,6 +105,9 @@ func InitServiceInfo(version string, buildTime time.Time, gitCommit string) { model.VendorIDTB: map[int]interface{}{ tbunionapi.TbElmActTypeBDH: "本地化", }, + model.VendorIDPDD: map[int]interface{}{ + 1: "进行中的活动", + }, }, }, } diff --git a/business/jxstore/partner/pdd/pdd.go b/business/jxstore/partner/pdd/pdd.go index 845afa21c..7e352ef36 100644 --- a/business/jxstore/partner/pdd/pdd.go +++ b/business/jxstore/partner/pdd/pdd.go @@ -20,7 +20,7 @@ func init() { } func getAPI() (apiobj *pddapi.API) { - if configs, err := dao.QueryConfigs(dao.GetDB(), "pddunionCookie", model.ConfigTypeCookie, ""); err == nil { + if configs, err := dao.QueryConfigs(dao.GetDB(), "pddCookie", model.ConfigTypeCookie, ""); err == nil { api.PddAPI.SetCookieWithStr(configs[0].Value) } return api.PddAPI diff --git a/business/jxstore/partner/pdd/union.go b/business/jxstore/partner/pdd/union.go index eb25b0879..61ab065f9 100644 --- a/business/jxstore/partner/pdd/union.go +++ b/business/jxstore/partner/pdd/union.go @@ -1,6 +1,7 @@ package pdd import ( + "git.rosy.net.cn/baseapi/utils" "git.rosy.net.cn/jx-callback/business/jxstore/partner" "git.rosy.net.cn/jx-callback/business/jxutils/jxcontext" ) @@ -10,6 +11,21 @@ func (s *UnionHandler) ShareUnionLink(ctx *jxcontext.Context, linkType, unionAct } func (s *UnionHandler) GetUnionActList(ctx *jxcontext.Context, actType int) (actList []*partner.ActivityList, err error) { + if result, err2 := getAPI().ActivityOperationList(); err2 == nil { + for _, v := range result { + act := &partner.ActivityList{ + ActID: v.ID, + ActName: v.Name, + ActDes: v.Description, + Ratio: "未知", + ActSrc: v.Fileurl, + Img: v.Bannerimage, + DateBegin: utils.Str2Time(v.Starttime), + DateEnd: utils.Str2Time(v.Endtime), + } + actList = append(actList, act) + } + } return actList, err }