新增菜单/导航条排序功能
This commit is contained in:
parent
ce142d0adb
commit
95e39a1e2c
|
@ -97,7 +97,7 @@ namespace Bootstrap.DataAccess
|
||||||
public static IEnumerable<Menu> RetrieveNavigationsByUserId(int userId)
|
public static IEnumerable<Menu> RetrieveNavigationsByUserId(int userId)
|
||||||
{
|
{
|
||||||
var navs = (userId == 0 ? RetrieveMenus() : RetrieveMenusByUserId(userId)).Where(m => m.Category == "0");
|
var navs = (userId == 0 ? RetrieveMenus() : RetrieveMenusByUserId(userId)).Where(m => m.Category == "0");
|
||||||
var root = navs.Where(m => m.ParentId == 0);
|
var root = navs.Where(m => m.ParentId == 0).OrderBy(m => m.Order);
|
||||||
CascadeMenu(navs, root);
|
CascadeMenu(navs, root);
|
||||||
return root;
|
return root;
|
||||||
}
|
}
|
||||||
|
@ -105,7 +105,7 @@ namespace Bootstrap.DataAccess
|
||||||
{
|
{
|
||||||
level.ToList().ForEach(m =>
|
level.ToList().ForEach(m =>
|
||||||
{
|
{
|
||||||
m.Menus = navs.Where(sub => sub.ParentId == m.ID);
|
m.Menus = navs.Where(sub => sub.ParentId == m.ID).OrderBy(sub => sub.Order);
|
||||||
CascadeMenu(navs, m.Menus);
|
CascadeMenu(navs, m.Menus);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -117,7 +117,7 @@ namespace Bootstrap.DataAccess
|
||||||
public static IEnumerable<Menu> RetrieveLinksByUserId(int userId)
|
public static IEnumerable<Menu> RetrieveLinksByUserId(int userId)
|
||||||
{
|
{
|
||||||
var navs = (userId == 0 ? RetrieveMenus() : RetrieveMenusByUserId(userId)).Where(m => m.Category == "1");
|
var navs = (userId == 0 ? RetrieveMenus() : RetrieveMenusByUserId(userId)).Where(m => m.Category == "1");
|
||||||
var root = navs.Where(m => m.ParentId == 0);
|
var root = navs.Where(m => m.ParentId == 0).OrderBy(m => m.Order);
|
||||||
CascadeMenu(navs, root);
|
CascadeMenu(navs, root);
|
||||||
return root;
|
return root;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue