article_celue_push.go 936 B

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