fix: 修正菜单名称CheckUnique方法中对ParentId的条件判断
This commit is contained in:
@@ -167,7 +167,7 @@ func (r SysMenu) CheckUnique(sysMenu model.SysMenu) int64 {
|
|||||||
tx := db.DB("").Model(&model.SysMenu{})
|
tx := db.DB("").Model(&model.SysMenu{})
|
||||||
tx = tx.Where("del_flag = '0'")
|
tx = tx.Where("del_flag = '0'")
|
||||||
// 查询条件拼接
|
// 查询条件拼接
|
||||||
if sysMenu.ParentId <= 0 {
|
if sysMenu.ParentId >= 0 {
|
||||||
tx = tx.Where("parent_id = ?", sysMenu.ParentId)
|
tx = tx.Where("parent_id = ?", sysMenu.ParentId)
|
||||||
}
|
}
|
||||||
if sysMenu.MenuName != "" {
|
if sysMenu.MenuName != "" {
|
||||||
|
|||||||
Reference in New Issue
Block a user