Skip to content

Commit 0403071

Browse files
author
qnnp
committed
修复: 剔除没有子菜单的一级主菜单
1 parent 0ee8c99 commit 0403071

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/plugin/admin/app/controller/RuleController.php

+4-1
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,10 @@ function get(Request $request): Response
8686
$this->removeNotContain($tree_items, 'id', $rules);
8787
}
8888
$this->removeNotContain($tree_items, 'type', $types);
89-
return $this->json(0, 'ok', Tree::arrayValues($tree_items));
89+
$menus = array_filter(Tree::arrayValues($tree_items), function ($item) {
90+
return count($item['children']);
91+
});
92+
return $this->json(0, 'ok', $menus);
9093
}
9194

9295
/**

0 commit comments

Comments
 (0)