修改v1/sys_menu.go的备注错误及代码优化
This commit is contained in:
@@ -4,6 +4,7 @@ import (
|
||||
"errors"
|
||||
"gin-vue-admin/global"
|
||||
"gin-vue-admin/model"
|
||||
"gin-vue-admin/model/request"
|
||||
"gorm.io/gorm"
|
||||
"strconv"
|
||||
)
|
||||
@@ -155,9 +156,9 @@ func AddMenuAuthority(menus []model.SysBaseMenu, authorityId string) (err error)
|
||||
// @return err error
|
||||
// @return menus []SysBaseMenu
|
||||
|
||||
func GetMenuAuthority(authorityId string) (err error, menus []model.SysMenu) {
|
||||
func GetMenuAuthority(info *request.GetAuthorityId) (err error, menus []model.SysMenu) {
|
||||
err = global.GVA_DB.Where("authority_id = ? ", info.AuthorityId).Order("sort").Find(&menus).Error
|
||||
//sql := "SELECT authority_menu.keep_alive,authority_menu.default_menu,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 = ? ORDER BY authority_menu.sort ASC"
|
||||
err = global.GVA_DB.Where("authority_id = ? ", authorityId).Order("sort").Find(&menus).Error
|
||||
//err = global.GVA_DB.Raw(sql, authorityId).Scan(&menus).Error
|
||||
return err, menus
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user