report_view_record.go 814 B

1234567891011121314151617181920212223242526
  1. package models
  2. import (
  3. "github.com/beego/beego/v2/client/orm"
  4. "time"
  5. )
  6. type ReportViewRecord struct {
  7. Id int `orm:"column(id);pk"`
  8. UserId int `description:"用户id"`
  9. ReportId int `description:"报告id"`
  10. Mobile string `description:"手机号"`
  11. Email string `description:"邮箱"`
  12. RealName string `description:"用户实际姓名"`
  13. CompanyName string `description:"公司名称"`
  14. CreateTime time.Time `description:"创建时间"`
  15. }
  16. //获取需要修复的数据列表
  17. func GetViewListByReportId(reportId int) (total int64, list []*ReportViewRecord, err error) {
  18. o := orm.NewOrmUsingDB("rddp")
  19. sql := `select * from report_view_record where report_id = ? order by id desc `
  20. total, err = o.Raw(sql, reportId).QueryRows(&list)
  21. return
  22. }