permission.go 633 B

123456789101112131415
  1. package models
  2. import "github.com/beego/beego/v2/client/orm"
  3. type ChartPermissionMappingIdName struct {
  4. PermissionId int
  5. PermissionName string
  6. }
  7. func GetChartPermissionNameFromMappingByKeyword(source string, classifyId int) (list []*ChartPermissionMappingIdName, err error) {
  8. o := orm.NewOrmUsingDB("rddp")
  9. sql := " SELECT b.chart_permission_id AS permission_id,b.permission_name FROM chart_permission_search_key_word_mapping AS a INNER JOIN chart_permission AS b ON a.chart_permission_id = b.chart_permission_id WHERE a.`from` = ? AND a.classify_id = ? "
  10. _, err = o.Raw(sql, source, classifyId).QueryRows(&list)
  11. return
  12. }