Skip to content

Commit

Permalink
fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
penghcheng committed Nov 26, 2019
1 parent 92e296d commit 118b7aa
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion app/Service/SysUserService.php
Original file line number Diff line number Diff line change
Expand Up @@ -207,10 +207,15 @@ public function getSysNemuList(int $user_id): array
*/
public function getSysNemuSelect()
{
$datas = Db::select('SELECT * FROM sys_menu where parent_id in (0,1) order by order_num ASC ;');
$datas = Db::select('SELECT * FROM sys_menu where parent_id = 0 order by order_num ASC ;');

if (empty($datas)) {
return [];
} else {
foreach ($datas as $k => $v) {
$tmp = Db::select('SELECT * FROM sys_menu where parent_id = ' . $v['menu_id'] . ' order by order_num ASC ;');
$datas = array_merge($datas, $tmp);
}
}
$menu_ids = array_column($datas, 'menu_id');
$menu_ids = array_unique($menu_ids);
Expand Down

0 comments on commit 118b7aa

Please sign in to comment.