123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566 |
- package models
- import (
- "github.com/beego/beego/v2/client/orm"
- )
- type ActivityType struct {
- ActivityTypeId int `description:"活动类型id"`
- ActivityTypeName string `description:"活动名称"`
- ShowType string `description:"人数限制类型,1不展示限制,2可选限制,3强制限制"`
- IsChoose bool `description:"是否选择"`
- OnlineIco string `description:"线上线下Ico图标"`
- }
- type ActivityTypeListResp struct {
- List []*ActivityType
- }
- //列表
- func GetActivityTypeList() (items []*ActivityType, err error) {
- o := orm.NewOrm()
- sql := `SELECT * FROM cygx_activity_type ORDER BY sort DESC`
- _, err = o.Raw(sql).QueryRows(&items)
- return
- }
- func GetActivityTypeDetailById(activityTypeId int) (item *ActivityType, err error) {
- o := orm.NewOrm()
- sql := `SELECT * FROM cygx_activity_type WHERE activity_type_id = ? `
- err = o.Raw(sql, activityTypeId).QueryRow(&item)
- return
- }
- type ActivityTypeListHomeResp struct {
- List []*ActivityTypeHome
- }
- type ActivityTypeHome struct {
- ActivityTypeId int `description:"活动类型id"`
- Resource int `description:"来源 ,1:活动 ,2:专项产业调研"`
- ActivityTypeName string `description:"活动类型名称"`
- OnlineIco string `description:"线上线下Ico图标"`
- ImgUrlBgPc string `description:"Pc端背景图片"`
- List []*CygxActivityLabelList
- }
- //活动详情
- type CygxActivityLabelList struct {
- KeyWord string `orm:"column(label)";description:"主题"`
- ImgUrlBg string `description:"背景图片"`
- ActivityId int `description:"活动ID "`
- Resource int `description:"来源 ,1:活动 ,2:专项产业调研"`
- IsNew bool `description:"是否为新:活动存在关联的的产业所关联的报告均在3个月内/无报告则标记新"`
- YidongActivityId int `description:"易董活动ID"`
- IsExternalLabel bool `description:"是否为外部资源"`
- IsShowSubjectName int `description:"小程序内是否展示标的名称 1是 ,0否 默认0 "`
- TemporaryLabel string `description:"临时标签"`
- }
- //列表
- func GetActivityTypeHomeList() (items []*ActivityTypeHome, err error) {
- o := orm.NewOrm()
- sql := `SELECT * FROM cygx_activity_type WHERE activity_type_id != 7 ORDER BY sort DESC`
- _, err = o.Raw(sql).QueryRows(&items)
- return
- }
|