Browse Source

修改错误的修改使用试图查询菜单的问题

main
rikugun 5 years ago
committed by GitHub
parent
commit
251f021982
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      server/service/sys_menu.go

6
server/service/sys_menu.go

@ -14,8 +14,7 @@ import (
// @return err error
// @return menus []model.SysMenu
func GetMenuTree(authorityId string) (err error, menus []model.SysMenu) {
//sql := "SELECT authority_menu.created_at,authority_menu.updated_at,authority_menu.deleted_at,authority_menu.menu_level,authority_menu.parent_id,authority_menu.path,authority_menu.`name`,authority_menu.hidden,authority_menu.component,authority_menu.title,authority_menu.icon,authority_menu.sort,authority_menu.menu_id,authority_menu.authority_id FROM sys_menus authority_menu WHERE authority_menu.authority_id = ? AND authority_menu.parent_id = ?"
sql := "SELECT authority_menu.created_at,authority_menu.updated_at,authority_menu.deleted_at,authority_menu.menu_level,authority_menu.parent_id,authority_menu.path,authority_menu.`name`,authority_menu.hidden,authority_menu.component,authority_menu.title,authority_menu.icon,authority_menu.sort,authority_menu.id menu_id,am.sys_authority_authority_id authority_id FROM sys_base_menus authority_menu left join sys_authority_menus am on authority_menu.id = am.sys_base_menu_id WHERE am.sys_authority_authority_id = ? AND authority_menu.parent_id = ? "
sql := "SELECT authority_menu.created_at,authority_menu.updated_at,authority_menu.deleted_at,authority_menu.menu_level,authority_menu.parent_id,authority_menu.path,authority_menu.`name`,authority_menu.hidden,authority_menu.component,authority_menu.title,authority_menu.icon,authority_menu.sort,authority_menu.menu_id,authority_menu.authority_id FROM authority_menu WHERE authority_menu.authority_id = ? AND authority_menu.parent_id = ?"
err = global.GVA_DB.Raw(sql, authorityId, 0).Scan(&menus).Error
for i := 0; i < len(menus); i++ {
err = getChildrenList(&menus[i], sql)
@ -119,8 +118,7 @@ func AddMenuAuthority(menus []model.SysBaseMenu, authorityId string) (err error)
// @return err error
// @return menus []SysBaseMenu
func GetMenuAuthority(authorityId string) (err error, menus []model.SysMenu) {
//sql := "SELECT authority_menu.created_at,authority_menu.updated_at,authority_menu.deleted_at,authority_menu.menu_level,authority_menu.parent_id,authority_menu.path,authority_menu.`name`,authority_menu.hidden,authority_menu.component,authority_menu.title,authority_menu.icon,authority_menu.sort,authority_menu.menu_id,authority_menu.authority_id FROM sys_menus authority_menu WHERE authority_menu.authority_id = ?"
sql := "SELECT authority_menu.created_at,authority_menu.updated_at,authority_menu.deleted_at,authority_menu.menu_level,authority_menu.parent_id,authority_menu.path,authority_menu.`name`,authority_menu.hidden,authority_menu.component,authority_menu.title,authority_menu.icon,authority_menu.sort,authority_menu.id menu_id,am.sys_authority_authority_id authority_id FROM sys_base_menus authority_menu left join sys_authority_menus am on authority_menu.id = am.sys_base_menu_id WHERE am.sys_authority_authority_id = ? "
sql := "SELECT authority_menu.created_at,authority_menu.updated_at,authority_menu.deleted_at,authority_menu.menu_level,authority_menu.parent_id,authority_menu.path,authority_menu.`name`,authority_menu.hidden,authority_menu.component,authority_menu.title,authority_menu.icon,authority_menu.sort,authority_menu.menu_id,authority_menu.authority_id FROM authority_menu WHERE authority_menu.authority_id = ?"
err = global.GVA_DB.Raw(sql, authorityId).Scan(&menus).Error
return err, menus
}
Loading…
Cancel
Save