article_history_record_all.go 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. package models
  2. import (
  3. "github.com/beego/beego/v2/client/orm"
  4. "time"
  5. )
  6. type CygxArticleHistoryRecordAll struct {
  7. Id int `orm:"column(id);pk"`
  8. ArticleId int
  9. UserId int
  10. CreateTime string
  11. ModifyTime time.Time
  12. Mobile string `description:"手机号"`
  13. Email string `description:"邮箱"`
  14. CompanyId int `description:"公司id"`
  15. CompanyName string `description:"公司名称"`
  16. StopTime int `description:"停留时间"`
  17. OutType int `description:"退出方式,1正常退出,2强制关闭"`
  18. Source string `description:"来源,MOBILE:手机端,PC:电脑端"`
  19. RealName string `description:"用户实际名称"`
  20. CreateDateApi time.Time `description:"同步创建时间"`
  21. CelueHistoryId int `description:"策略平台记录的ID"`
  22. Platfor int `description:"PV阅读记录来源,1:查研观向,2:策略平台"`
  23. IsDel int `description:"是否删除"`
  24. }
  25. // 获取数量
  26. func GetCygxArticleHistoryRecordAllCountBycondition(condition string, pars []interface{}) (count int, err error) {
  27. sqlCount := ` SELECT COUNT(1) AS count FROM cygx_article_history_record_all as art WHERE 1= 1 `
  28. if condition != "" {
  29. sqlCount += condition
  30. }
  31. o := orm.NewOrm()
  32. err = o.Raw(sqlCount, pars).QueryRow(&count)
  33. return
  34. }
  35. // 列表
  36. func GetCygxArticleHistoryRecordAllList(condition string, pars []interface{}, startSize, pageSize int) (items []*CygxArticleHistoryRecordAll, err error) {
  37. o := orm.NewOrm()
  38. sql := `SELECT * FROM cygx_article_history_record_all as art WHERE 1= 1 `
  39. if condition != "" {
  40. sql += condition
  41. }
  42. sql += ` LIMIT ?,? `
  43. _, err = o.Raw(sql, pars, startSize, pageSize).QueryRows(&items)
  44. return
  45. }