activity_type.go 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. package models
  2. import (
  3. "github.com/beego/beego/v2/client/orm"
  4. )
  5. type ActivityType struct {
  6. ActivityTypeId int `description:"活动类型id"`
  7. ActivityTypeName string `description:"活动名称"`
  8. ShowType string `description:"人数限制类型,1不展示限制,2可选限制,3强制限制"`
  9. IsChoose bool `description:"是否选择"`
  10. OnlineIco string `description:"线上线下Ico图标"`
  11. }
  12. type ActivityTypeListResp struct {
  13. List []*ActivityType
  14. }
  15. //列表
  16. func GetActivityTypeList() (items []*ActivityType, err error) {
  17. o := orm.NewOrm()
  18. sql := `SELECT * FROM cygx_activity_type ORDER BY sort DESC`
  19. _, err = o.Raw(sql).QueryRows(&items)
  20. return
  21. }
  22. func GetActivityTypeDetailById(activityTypeId int) (item *ActivityType, err error) {
  23. o := orm.NewOrm()
  24. sql := `SELECT * FROM cygx_activity_type WHERE activity_type_id = ? `
  25. err = o.Raw(sql, activityTypeId).QueryRow(&item)
  26. return
  27. }
  28. type ActivityTypeListHomeResp struct {
  29. List []*ActivityTypeHome
  30. }
  31. type ActivityTypeHome struct {
  32. ActivityTypeId int `description:"活动类型id"`
  33. Resource int `description:"来源 ,1:活动 ,2:专项产业调研"`
  34. ActivityTypeName string `description:"活动类型名称"`
  35. OnlineIco string `description:"线上线下Ico图标"`
  36. ImgUrlBgPc string `description:"Pc端背景图片"`
  37. List []*CygxActivityLabelList
  38. }
  39. //活动详情
  40. type CygxActivityLabelList struct {
  41. KeyWord string `orm:"column(label)";description:"主题"`
  42. ImgUrlBg string `description:"背景图片"`
  43. ActivityId int `description:"活动ID "`
  44. Resource int `description:"来源 ,1:活动 ,2:专项产业调研"`
  45. IsNew bool `description:"是否为新:活动存在关联的的产业所关联的报告均在3个月内/无报告则标记新"`
  46. YidongActivityId int `description:"易董活动ID"`
  47. IsExternalLabel bool `description:"是否为外部资源"`
  48. IsShowSubjectName int `description:"小程序内是否展示标的名称 1是 ,0否 默认0 "`
  49. TemporaryLabel string `description:"临时标签"`
  50. }
  51. //列表
  52. func GetActivityTypeHomeList() (items []*ActivityTypeHome, err error) {
  53. o := orm.NewOrm()
  54. sql := `SELECT * FROM cygx_activity_type WHERE activity_type_id != 7 ORDER BY sort DESC`
  55. _, err = o.Raw(sql).QueryRows(&items)
  56. return
  57. }