article_celue_push.go 1.1 KB

123456789101112131415161718192021222324252627282930313233343536
  1. package models
  2. import (
  3. "github.com/beego/beego/v2/client/orm"
  4. "time"
  5. )
  6. type CygxArticleCeluePush struct {
  7. Id int `description:"新ID"`
  8. ArticleId int `description:"文章ID"`
  9. IsHandle int `description:"文章ID"`
  10. Action string `description:"日志类型:add,edit,move"`
  11. ModifyTime string `description:"修改时间"`
  12. CreateTime string `description:"创建时间"`
  13. }
  14. func GetArticleCeluePushList() (item []*CygxArticleCeluePush, err error) {
  15. o := orm.NewOrm()
  16. sql := ` SELECT * FROM cygx_article_celue_push WHERE is_handle = 0 AND create_time >DATE_SUB(NOW(), INTERVAL 10 MINUTE) GROUP BY article_id `
  17. _, err = o.Raw(sql).QueryRows(&item)
  18. return
  19. }
  20. // 更改推送内容是否处理状态
  21. func UpdateCygxArticleCeluePush(articleId int) (err error) {
  22. o := orm.NewOrm()
  23. sql := `UPDATE cygx_article_celue_push SET is_handle=1 WHERE article_id=? `
  24. _, err = o.Raw(sql, articleId).Exec()
  25. return
  26. }
  27. type CygxArticleCeluePushRedis struct {
  28. ArticleId int `description:"文章ID"`
  29. Action string `description:"日志类型:add,edit,move"`
  30. CreateTime time.Time `description:"创建时间"`
  31. }