activity_type.go 3.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  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(condition string) (items []*ActivityType, err error) {
  17. o := orm.NewOrm()
  18. sql := `SELECT * FROM cygx_activity_type WHERE 1= 1 ` + condition + ` 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. IsResearchPoints bool `description:"是否为研选扣点"`
  49. IsShowSubjectName int `description:"小程序内是否展示标的名称 1是 ,0否 默认0 "`
  50. TemporaryLabel string `description:"临时标签"`
  51. TripStatus int `description:"行程进行状态 1:预报名,2:确定行程"`
  52. City string `description:"城市"`
  53. Days int `description:"天数"`
  54. IsResearch bool `description:"是否属于研选"`
  55. }
  56. // 列表
  57. func GetActivityTypeHomeList(condition string) (items []*ActivityTypeHome, err error) {
  58. o := orm.NewOrm()
  59. sql := `SELECT * FROM cygx_activity_type WHERE activity_type_id != 7 ` + condition + ` ORDER BY sort DESC`
  60. _, err = o.Raw(sql).QueryRows(&items)
  61. return
  62. }
  63. type ActivityCcustomerType struct {
  64. CustomerTypeId int `description:"活动类型id"`
  65. CustomerName string `description:"活动名称"`
  66. PermissionValue string `description:"用户权限对应的值"`
  67. }
  68. // 列表
  69. func GetActivityCcustomerTypeList() (items []*ActivityCcustomerType, err error) {
  70. o := orm.NewOrm()
  71. sql := `SELECT * FROM cygx_customer_type ORDER BY sort DESC`
  72. _, err = o.Raw(sql).QueryRows(&items)
  73. return
  74. }