|
|
|
@ -44,6 +44,7 @@ Class SiteController extends Controller {
@@ -44,6 +44,7 @@ Class SiteController extends Controller {
|
|
|
|
|
|
|
|
|
|
//排序 |
|
|
|
|
if (!empty($menus_sorted) && !empty($menus)) { |
|
|
|
|
//一级目录菜单排序 |
|
|
|
|
$menu_dirs = array_column($menus, 'directory'); |
|
|
|
|
$names = array_replace(array_flip($menus_sorted), array_flip($menu_dirs)); |
|
|
|
|
if (!empty($names)) { |
|
|
|
@ -57,7 +58,7 @@ Class SiteController extends Controller {
@@ -57,7 +58,7 @@ Class SiteController extends Controller {
|
|
|
|
|
$menus = $arr; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//dirTree排序 |
|
|
|
|
//dirTree一级目录排序 |
|
|
|
|
$sorted_dirs = array_column($menus, 'directory'); |
|
|
|
|
$tree_dirs = array_column($dirTree, 'directory'); |
|
|
|
|
$names = array_replace(array_flip($sorted_dirs), array_flip($tree_dirs)); |
|
|
|
@ -67,7 +68,7 @@ Class SiteController extends Controller {
@@ -67,7 +68,7 @@ Class SiteController extends Controller {
|
|
|
|
|
$arr = []; |
|
|
|
|
foreach($sorted_dirs as $name) { |
|
|
|
|
foreach($dirTree as $index => $item) { |
|
|
|
|
if ($item['directory'] == $name) { |
|
|
|
|
if (!empty($item['directory']) && $item['directory'] == $name) { |
|
|
|
|
array_push($arr, $item); |
|
|
|
|
break; |
|
|
|
|
} |
|
|
|
|