industrial_management.go 742 B

1234567891011121314151617181920212223242526
  1. package models
  2. import (
  3. "github.com/beego/beego/v2/client/orm"
  4. )
  5. type IndustrialManagementRep struct {
  6. IndustrialManagementId int `description:"产业ID"`
  7. ChartPermissionId int `description:"权限id"`
  8. IndustryName string `description:"产业名称"`
  9. IsFllow bool `description:"是否关注"`
  10. }
  11. // 获取所有的产业
  12. func GetindustrialManagement() (items []*IndustrialManagementRep, err error) {
  13. o := orm.NewOrm()
  14. sql := `SELECT
  15. i.*
  16. FROM
  17. cygx_industrial_management AS i
  18. INNER JOIN cygx_industrial_article_group_management AS m ON m.industrial_management_id = i.industrial_management_id
  19. GROUP BY
  20. i.industrial_management_id `
  21. _, err = o.Raw(sql).QueryRows(&items)
  22. return
  23. }