|
@@ -98,7 +98,7 @@ func GetYbChartPermissionFirstByName(classifyName string) (item *YbChartPermissi
|
|
|
// GetChartPermissionById 主键获取权限
|
|
|
func GetChartPermissionByRemark(remark string) (item *ChartPermission, err error) {
|
|
|
o := orm.NewOrm()
|
|
|
- sql := `SELECT * FROM chart_permission WHERE remark = ? LIMIT 1`
|
|
|
+ sql := `SELECT * FROM chart_permission WHERE remark = ? and parent_id > 0 LIMIT 1`
|
|
|
err = o.Raw(sql, remark).QueryRow(&item)
|
|
|
return
|
|
|
}
|
|
@@ -136,7 +136,7 @@ func GetChartPermissionByNames(permissionNames []string) (list []*ChartPermissio
|
|
|
// GetChartPermissionList 获取品种权限列表
|
|
|
func GetChartPermissionList() (list []*ChartPermission, err error) {
|
|
|
o := orm.NewOrm()
|
|
|
- sql := `SELECT * FROM chart_permission `
|
|
|
+ sql := `SELECT * FROM chart_permission where parent_id > 0 `
|
|
|
_, err = o.Raw(sql).QueryRows(&list)
|
|
|
return
|
|
|
}
|
|
@@ -144,7 +144,7 @@ func GetChartPermissionList() (list []*ChartPermission, err error) {
|
|
|
// 获取权益主观权限
|
|
|
func GetChartPermissionListRaiSubjectivity() (items []*ChartPermission, err error) {
|
|
|
o := orm.NewOrm()
|
|
|
- sql := `SELECT * FROM chart_permission WHERE product_id=2 AND permission_type = 1 ORDER BY sort ASC `
|
|
|
+ sql := `SELECT * FROM chart_permission WHERE product_id=2 AND permission_type = 1 and parent_id > 0 ORDER BY sort ASC `
|
|
|
_, err = o.Raw(sql).QueryRows(&items)
|
|
|
return
|
|
|
}
|