activity_remind.go 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. package yb
  2. import (
  3. "github.com/beego/beego/v2/client/orm"
  4. "time"
  5. )
  6. // ActivityRemind 活动会议提醒表
  7. type ActivityRemind struct {
  8. ActivityRemindId int `orm:"column(activity_remind_id);pk" description:"活动提醒ID"`
  9. ActivityId int `description:"活动ID"`
  10. UserId int `description:"微信用户表ID"`
  11. CompanyId int `description:"客户id"`
  12. RealName string `description:"用户实际名称"`
  13. Mobile string `description:"用户手机号"`
  14. //RegisterState int8 `description:"报名状态 0-取消报名 1-已报名"`
  15. CreateTime time.Time `description:"创建时间"`
  16. }
  17. // TableName 表名变更
  18. func (activityRemind *ActivityRemind) TableName() string {
  19. return "yb_activity_remind"
  20. }
  21. // GetAllActivityRemindListByActivityId 根据活动id获取所有的提醒用户
  22. func GetAllActivityRemindListByActivityId(activityId int) (list []*ActivityRemind, err error) {
  23. o := orm.NewOrm()
  24. sql := "select * from yb_activity_remind where activity_id = ? "
  25. sql += ` order by activity_remind_id asc ` //按照预约时间正序
  26. _, err = o.Raw(sql, activityId).QueryRows(&list)
  27. return
  28. }
  29. // Update 更新活动报名
  30. func (activityRemind *ActivityRemind) Update(cols []string) (err error) {
  31. o := orm.NewOrm()
  32. _, err = o.Update(activityRemind, cols...)
  33. return
  34. }