celue_article_history_record.go 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. package models
  2. import (
  3. "github.com/beego/beego/v2/client/orm"
  4. "time"
  5. )
  6. type CeLueArticleResultApi struct {
  7. Data []CeLueArticleResultApidate `json:"data"`
  8. Code int `json:"code"`
  9. Msg string `json:"msg"`
  10. Pagination *Pagination `json:"pagination"`
  11. }
  12. type CeLueArticleResultApidate struct {
  13. CelueHistoryId int `json:"id"`
  14. Mobile string `json:"phone_number"`
  15. ArticleId string `json:"parameter"`
  16. CreateDate string `json:"access_time"`
  17. CrmUser *CrmUser `json:"user"`
  18. CompanyName *CrmUser `json:"crm_company"`
  19. }
  20. type CrmUser struct {
  21. RealName string `json:"name"`
  22. }
  23. type CrmCompany struct {
  24. CompanyName string `json:"name"`
  25. }
  26. func GetCeLueArticleCountById(celueHistoryId int) (count int, err error) {
  27. o := orm.NewOrm()
  28. sql := `SELECT COUNT(1) AS count FROM cygx_celue_article_history_record WHERE celue_history_id = ? `
  29. err = o.Raw(sql, celueHistoryId).QueryRow(&count)
  30. return
  31. }
  32. type CygxCelueArticleHistoryRecord struct {
  33. Id int `orm:"column(id);pk"`
  34. ArticleId string `description:"文章ID"`
  35. CelueHistoryId int `description:"策略平台记录的ID"`
  36. CreateTime string `description:"本地创建时间"`
  37. CreateDateApi time.Time `description:"图表创建时间"`
  38. Mobile string `description:"手机号"`
  39. CompanyName string `description:"公司名称"`
  40. RealName string `description:"用户姓名"`
  41. }
  42. //新增
  43. func AddCeLueArticle(item *CygxCelueArticleHistoryRecord) (lastId int64, err error) {
  44. o := orm.NewOrm()
  45. lastId, err = o.Insert(item)
  46. return
  47. }