zhouqi_article_map.go 712 B

123456789101112131415161718192021222324252627282930
  1. package models
  2. import (
  3. "github.com/beego/beego/v2/client/orm"
  4. )
  5. type CygxZhouqiArticleMap struct {
  6. CategoryId int `description:"产业Id"`
  7. MatchTypeName string `description:"行业名称"`
  8. SeriesName string `description:"系列名称"`
  9. ArticleUpdateTime string `description:"对应文章的更新时间"`
  10. }
  11. // 获取周期下面的一级分类
  12. func GetCygxZhouqiArticleMapFirst() (items []*CygxZhouqiArticleMap, err error) {
  13. o := orm.NewOrmUsingDB("hz_cygx")
  14. sql := `SELECT
  15. category_id,
  16. match_type_name,
  17. series_name
  18. FROM
  19. cygx_zhouqi_article_map
  20. WHERE
  21. hidden = 0
  22. AND parent_id = 0
  23. ORDER BY
  24. sort DESC `
  25. _, err = o.Raw(sql).QueryRows(&items)
  26. return
  27. }