mirror of
https://gitee.com/ccnetcore/Yi
synced 2026-03-20 08:26:37 +08:00
完善表格模块
This commit is contained in:
@@ -43,7 +43,7 @@ namespace Yi.Framework.Service
|
||||
|
||||
public async Task<List<menu>> GetTopMenusByTopMenuIds(List<int> menuIds)
|
||||
{
|
||||
return await _DbRead.Set<menu>().Where(u => menuIds.Contains(u.id)).ToListAsync();
|
||||
return await _DbRead.Set<menu>().AsNoTracking().Where(u => menuIds.Contains(u.id)).ToListAsync();
|
||||
}
|
||||
|
||||
public async Task<menu> SetMouldByMenu(int id1,int id2)
|
||||
|
||||
@@ -45,9 +45,9 @@ namespace Yi.Framework.Service
|
||||
}
|
||||
public async Task<List<menu>> GetTopMenusByRoleId(int roleId)
|
||||
{
|
||||
var role_data = await _Db.Set<role>().Where(u => u.id == roleId).FirstOrDefaultAsync();
|
||||
var role_data = await _Db.Set<role>().Include(u=>u.menus).Where(u => u.id == roleId).FirstOrDefaultAsync();
|
||||
var menuList = role_data.menus.Where(u => u.is_delete == Normal).ToList();
|
||||
menuList.ForEach(u => u.children = null);
|
||||
|
||||
return menuList;
|
||||
}
|
||||
|
||||
|
||||
@@ -54,7 +54,7 @@ namespace Yi.Framework.Service
|
||||
return menuList;
|
||||
}
|
||||
|
||||
public async Task<List<menu>> GetMenuByHttpUser(int userId)
|
||||
public async Task<menu> GetMenuByHttpUser(int userId)
|
||||
{
|
||||
var user_data = await GetUserById(userId);
|
||||
List<menu> menuList = new();
|
||||
@@ -78,7 +78,7 @@ namespace Yi.Framework.Service
|
||||
}
|
||||
|
||||
|
||||
return TopMenuBuild2(TopMenuBuild(endMenu, allMenuIds));
|
||||
return TopMenuBuild2(TopMenuBuild(endMenu, allMenuIds))[0];
|
||||
}
|
||||
/// <summary>
|
||||
/// 这种就命名的话,改成MenuIconAndShowBuild
|
||||
|
||||
Reference in New Issue
Block a user