askserie_video_history_record.go 1.2 KB

123456789101112131415161718192021222324252627282930313233343536
  1. package models
  2. import (
  3. "github.com/beego/beego/v2/client/orm"
  4. "time"
  5. )
  6. type CygxAskserieVideoHistoryRecord struct {
  7. Id int `orm:"column(id);pk"`
  8. AskserieVideoId int `description:"askserie_video_id"`
  9. UserId int `description:"用户ID"`
  10. CreateTime time.Time `description:"创建时间"`
  11. Mobile string `description:"手机号"`
  12. Email string `description:"邮箱"`
  13. CompanyId int `description:"公司id"`
  14. CompanyName string `description:"公司名称"`
  15. RealName string `description:"用户实际名称"`
  16. SellerName string `description:"所属销售"`
  17. RegisterPlatform int `description:"来源 1小程序,2:网页"`
  18. ModifyTime time.Time `description:"更新时间"`
  19. VideoDuration int `description:"播放时长"`
  20. }
  21. // 添加
  22. func AddCygxAskserieVideoHistoryRecord(item *CygxAskserieVideoHistoryRecord) (err error) {
  23. o := orm.NewOrm()
  24. _, err = o.Insert(item)
  25. return
  26. }
  27. func UpdateAskserieVideoCounts(askserieVideoId int) (err error) {
  28. sql := `UPDATE cygx_askserie_video SET video_counts = video_counts+1 WHERE askserie_video_id = ? `
  29. o := orm.NewOrm()
  30. _, err = o.Raw(sql, askserieVideoId).Exec()
  31. return
  32. }