package models import ( "github.com/beego/beego/v2/client/orm" "time" ) type ReportViewRecord struct { Id int `orm:"column(id);pk"` UserId int `description:"用户id"` ReportId int `description:"报告id"` Mobile string `description:"手机号"` Email string `description:"邮箱"` RealName string `description:"用户实际姓名"` CompanyName string `description:"公司名称"` CreateTime time.Time `description:"创建时间"` } //添加报告阅读记录 func AddReportViewRecord(item *ReportViewRecord) (err error) { o := orm.NewOrmUsingDB("rddp") _, err = o.Insert(item) return } //修改最新阅读时间 func SetWxUserReportLastViewTime(uid int) (err error) { o := orm.NewOrm() sql := `UPDATE wx_user SET report_last_view_time=NOW() WHERE user_id=? ` _, err = o.Raw(sql, uid).Exec() return }