activity_special.go 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. package models
  2. import (
  3. //"fmt"
  4. "github.com/beego/beego/v2/client/orm"
  5. "time"
  6. )
  7. // 专项调研活动列表
  8. type CygxActivitySpecialDetail struct {
  9. ActivityId int `description:"活动ID "`
  10. ActivityTypeName string `description:"活动名称"`
  11. SpecialType int `description:"调研形式、 1 线上 , 2 线下"`
  12. City string `description:"调研城市"`
  13. ChartPermissionName string `description:"行业名称"`
  14. ChartPermissionId int `description:"行业Id"`
  15. ResearchTheme string `description:"调研主题"`
  16. ActivityTimeText string `description:"活动预期时间带文字"`
  17. TripImgLink string `description:"行程图片链接"`
  18. IsSignup int `description:"是否感兴趣 1是 ,0 否"`
  19. Label string `description:"主题标签"`
  20. ImgUrl string `description:"图片链接"`
  21. ImgUrlText string `description:"图片链接文字"`
  22. IndustrialName string `description:"产业名称"`
  23. IndustrialSubjectName string `description:"标的名称(相关公司)"`
  24. Scale string `description:"管理规模,空不填,1::50亿以下,2:50~100亿,3:100亿以上。多个用, 隔开"`
  25. CustomerTypeIds string `description:"活动可见的客户类型,多个ID用 , 隔开"`
  26. IsTrip int `description:"是否报名 1是 ,0 否"`
  27. TripNum int `description:"已报名人数"`
  28. Days int `description:"调研天数"`
  29. Host string `description:"主持人"`
  30. PersonInCharge string `description:"纪要负责人"`
  31. LimitPeopleNum int `description:"限制人数数量"`
  32. TripImgLinkFix string `description:"确定行程之后的图片链接"`
  33. ActivityTimeTextByDay string `description:"活动预期时间带周日"`
  34. ActivityTime string `description:"活动预期时间"`
  35. ActivityTimeEnd string `description:"活动预期结束时间"`
  36. ActiveState int `description:"活动进行状态 未开始:1、进行中2、已结束3"`
  37. TripStatus int `description:"行程进行状态 1:预报名,2:确定行程"`
  38. Explain string `description:"说明"`
  39. AdminId int `description:"管理员ID"`
  40. LastUpdatedTime time.Time `description:"更新时间"`
  41. }
  42. // 获取数量
  43. func GetActivitySpecialCount(condition string, pars []interface{}) (count int, err error) {
  44. sqlCount := ` SELECT COUNT(1) AS count FROM cygx_activity_special as art WHERE 1= 1 `
  45. if condition != "" {
  46. sqlCount += condition
  47. }
  48. o := orm.NewOrm()
  49. err = o.Raw(sqlCount, pars).QueryRow(&count)
  50. return
  51. }
  52. // 主题列表
  53. func GetActivitySpecialListAll(condition string, pars []interface{}, startSize, pageSize int) (items []*CygxActivitySpecialDetail, err error) {
  54. o := orm.NewOrm()
  55. sql := `SELECT *
  56. FROM cygx_activity_special as art WHERE 1= 1 `
  57. if condition != "" {
  58. sql += condition
  59. }
  60. sql += ` ORDER BY art.last_updated_time DESC LIMIT ?,? `
  61. _, err = o.Raw(sql, pars, startSize, pageSize).QueryRows(&items)
  62. return
  63. }
  64. // 修改发布状态
  65. func UpdateActivitySpecialPublishStatus(publishStatus, activityId int) (err error) {
  66. sql := ` UPDATE cygx_activity_special SET publish_status= ? WHERE activity_id = ?`
  67. o := orm.NewOrm()
  68. _, err = o.Raw(sql, publishStatus, activityId).Exec()
  69. return
  70. }