xzs_choose_send.go 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. package models
  2. import (
  3. "github.com/beego/beego/v2/client/orm"
  4. "time"
  5. )
  6. type CygxXzsChooseSend struct {
  7. Id int `orm:"column(id);pk"`
  8. UserId int `description:"用户ID"`
  9. Mobile string `description:"手机号"`
  10. Email string `description:"邮箱"`
  11. CompanyId int `description:"公司id"`
  12. CompanyName string `description:"公司名称"`
  13. RealName string `description:"用户实际名称"`
  14. IsRefuse int `description:"是否拒绝推送,0否、1是 如果为1 则不做任何推送"`
  15. IsSubjective int `description:"是否选择主观推送, 1 是 、 0否"`
  16. IsObjective int `description:"是否选择客观推送, 1 是 、 0否"`
  17. CreateTime time.Time `description:"创建时间"`
  18. ModifyTime time.Time `description:"更新时间"`
  19. AllInYiYao int `description:"是否选择医药全部赛道"`
  20. AllInXiaoFei int `description:"是否选择消费全部赛道"`
  21. AllInKeJi int `description:"是否选择科技全部赛道"`
  22. AllInZhiZao int `description:"是否选择智造全部赛道"`
  23. AllInCeLue int `description:"是否选择策略全部赛道"`
  24. AllInYanXuan int `description:"是否选择研选全部赛道"`
  25. }
  26. //获取提交过推送规则用户的userId
  27. func GetCygxXzsChooseSend() (items []*CygxXzsChooseSend, err error) {
  28. o := orm.NewOrm()
  29. sql := `SELECT * FROM cygx_xzs_choose_send `
  30. _, err = o.Raw(sql).QueryRows(&items)
  31. return
  32. }
  33. //获取某个行业勾选全部赛道的用户
  34. func GetCygxXzsChooseSendByAllIn(allIn string) (items []*CygxXzsChooseSend, err error) {
  35. o := orm.NewOrm()
  36. sql := `SELECT * FROM cygx_xzs_choose_send WHERE ` + allIn + ` = 1 `
  37. _, err = o.Raw(sql).QueryRows(&items)
  38. return
  39. }
  40. //修改某个用户的行业是否勾选全部赛道
  41. func UpdateCygxXzsChooseSendIsAllIn(allIn string, isAllIn, userId int) (err error) {
  42. o := orm.NewOrm()
  43. sql := `UPDATE cygx_xzs_choose_send SET ` + allIn + ` = ? WHERE user_id = ?`
  44. _, err = o.Raw(sql, isAllIn, userId).Exec()
  45. return
  46. }