user_template_record.go 825 B

12345678910111213141516171819202122232425262728293031
  1. package models
  2. import "github.com/beego/beego/v2/client/orm"
  3. type UserTemplateRecord struct {
  4. Id int `orm:"column(id);pk"`
  5. UserId int
  6. OpenId string
  7. Resource string
  8. SendData string
  9. Result string
  10. CreateDate string
  11. CreateTime string
  12. SendStatus int
  13. SendType int
  14. }
  15. //添加banner
  16. func AddUserTemplateRecord(item *UserTemplateRecord) (err error) {
  17. o := orm.NewOrm()
  18. _, err = o.Insert(item)
  19. return
  20. }
  21. //GeUserTemplateRecordListBysendType 根据模板消息会议类型,获取已推送的用户的信息
  22. func GeUserTemplateRecordListBysendType(sendType int, resource string) (items []*UserTemplateRecord, err error) {
  23. sql := `SELECT * FROM user_template_record WHERE send_type = ? AND resource = ? `
  24. o := orm.NewOrm()
  25. _, err = o.Raw(sql, sendType, resource).QueryRows(&items)
  26. return
  27. }