activity_type.go 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  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. //TemplateP string `description:"活动模板,带P标签"`
  9. //Template string `description:"活动模板"`
  10. ShowType string `description:"人数限制类型,1不展示限制,2可选限制,3强制限制"`
  11. IsChoose bool `description:"是否选择"`
  12. OnlineIco string `description:"线上线下Ico图标"`
  13. }
  14. type ActivityTypeListResp struct {
  15. List []*ActivityType
  16. }
  17. //列表
  18. func GetActivityTypeList() (items []*ActivityType, err error) {
  19. o := orm.NewOrm()
  20. sql := `SELECT * FROM cygx_activity_type ORDER BY sort DESC`
  21. _, err = o.Raw(sql).QueryRows(&items)
  22. return
  23. }
  24. func GetActivityTypeDetailById(activityTypeId int) (item *ActivityType, err error) {
  25. o := orm.NewOrm()
  26. sql := `SELECT * FROM cygx_activity_type WHERE activity_type_id = ? `
  27. err = o.Raw(sql, activityTypeId).QueryRow(&item)
  28. return
  29. }
  30. type ActivityTypeListHomeResp struct {
  31. List []*ActivityTypeHome
  32. }
  33. type ActivityTypeListHomeRespPc struct {
  34. List []*ActivityTypeHomePc
  35. }
  36. type ActivityTypeHome struct {
  37. ActivityTypeId int `description:"活动类型id"`
  38. ActivityTypeName string `description:"活动名称"`
  39. ImgUrl string `description:"图片"`
  40. ImgUrlBg string `description:"背景图片"`
  41. ImgUrlBgs string `description:"背景图片"`
  42. Position int `description:"位置 ,1:左 ,2:右边"`
  43. Resource int `description:"位置 ,1:活动 ,2:专项产业调研"`
  44. List []*CygxActivityLabelList
  45. }
  46. type ActivityTypeHomePc struct {
  47. ActivityTypeId int `description:"活动类型id"`
  48. ActivityTypeName string `description:"活动名称"`
  49. OnlineIco string `description:"线上线下Ico图标"`
  50. ImgUrlBgPc string `description:"Pc端背景图片"`
  51. List []*CygxActivityLabelList
  52. }
  53. //列表
  54. func GetActivityTypeHomeList() (items []*ActivityTypeHome, err error) {
  55. o := orm.NewOrm()
  56. sql := `SELECT * FROM cygx_activity_type ORDER BY sort DESC`
  57. _, err = o.Raw(sql).QueryRows(&items)
  58. return
  59. }
  60. //列表
  61. func GetActivityTypeHomeListPc() (items []*ActivityTypeHomePc, err error) {
  62. o := orm.NewOrm()
  63. sql := `SELECT * FROM cygx_activity_type ORDER BY sort DESC`
  64. _, err = o.Raw(sql).QueryRows(&items)
  65. return
  66. }