chart_permission.go 1.2 KB

123456789101112131415161718192021222324252627
  1. package models
  2. import (
  3. "github.com/beego/beego/v2/client/orm"
  4. )
  5. type ChartPermissionResp struct {
  6. ChartPermissionId int `description:"权限id"`
  7. PermissionName string `description:"权限名称"`
  8. HasCheck bool `description:"是否有权限"`
  9. AllTracks string `default:"全部赛道";description:"全部赛道"`
  10. //List []*IndustrialManagementRep
  11. ListFollow []*IndustrialManagementRep // 重点关注
  12. CheckListFollow []int // 重点关注的ID
  13. ListPush []*IndustrialManagementRep // 接受推送
  14. CheckListPush []int // 接受推送的ID
  15. ListUninterested []*IndustrialManagementRep // 不感兴趣
  16. CheckListUninterested []int // 不感兴趣的ID
  17. //CheckList []int
  18. }
  19. func GetChartPermissionAll(condition string, pars []interface{}) (items []*ChartPermissionResp, err error) {
  20. o := orm.NewOrm()
  21. sql := `SELECT * FROM chart_permission WHERE product_id=2 AND is_report=1 AND permission_type!=2 AND chart_permission_id != 52 ` + condition + ` ORDER BY sort ASC `
  22. _, err = o.Raw(sql, pars).QueryRows(&items)
  23. return
  24. }