chart_permission.go 1.1 KB

1234567891011121314151617181920212223242526272829303132
  1. package cygx
  2. import (
  3. "github.com/beego/beego/v2/client/orm"
  4. "time"
  5. )
  6. type ChartPermission struct {
  7. ChartPermissionId int `description:"权限id"`
  8. PermissionName string `description:"权限名称"`
  9. IcoLink string `description:"图标链接"`
  10. List []*CygxIndustrialManagementNumCheckName
  11. }
  12. type CygxIndustrialManagementNumCheckName struct {
  13. ChartPermissionId int `orm:"column(industrial_management_id);pk" description:"产业id"`
  14. PermissionName string `orm:"column(industry_name)" description:"产业名称"`
  15. RecommendedIndex int `description:"推荐指数"`
  16. CreateTime time.Time `description:"创建时间"`
  17. LayoutTime string `description:"布局时间"`
  18. ArtNum int `description:"文章数量"`
  19. IsRelevance bool `description:"是否存在关联文章"`
  20. }
  21. func GetChartPermissionAll() (items []*ChartPermission, err error) {
  22. o := orm.NewOrm()
  23. sql := `SELECT * FROM chart_permission WHERE product_id=2 AND is_report=1 AND is_other = 0 AND permission_type != 2 ORDER BY sort ASC `
  24. _, err = o.Raw(sql).QueryRows(&items)
  25. return
  26. }