article_history_record_all.go 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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. RegisterPlatform int `description:"来源 1小程序,2:网页"`
  25. CompanyStatus string `description:"公司状态"`
  26. SellerName string `description:"所属销售"`
  27. }
  28. // 获取数量
  29. func GetCygxArticleHistoryRecordAllCountBycondition(condition string, pars []interface{}) (count int, err error) {
  30. sqlCount := ` SELECT COUNT(1) AS count FROM cygx_article_history_record_all as art WHERE 1= 1 `
  31. if condition != "" {
  32. sqlCount += condition
  33. }
  34. o := orm.NewOrm()
  35. err = o.Raw(sqlCount, pars).QueryRow(&count)
  36. return
  37. }
  38. // 列表
  39. func GetCygxArticleHistoryRecordAllList(condition string, pars []interface{}, startSize, pageSize int) (items []*CygxArticleHistoryRecordAll, err error) {
  40. o := orm.NewOrm()
  41. sql := `SELECT * FROM cygx_article_history_record_all as art WHERE 1= 1 `
  42. if condition != "" {
  43. sql += condition
  44. }
  45. sql += ` LIMIT ?,? `
  46. _, err = o.Raw(sql, pars, startSize, pageSize).QueryRows(&items)
  47. return
  48. }