Skip to content

Commit 0fc39af

Browse files
committed
导航菜单筛选fix
1 parent 4971b3f commit 0fc39af

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/Http/Controllers/NavigationController.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,13 @@ class NavigationController extends Controller
1616
*/
1717
public function index(Request $request)
1818
{
19+
$where = request_intersect(['type', 'guard_name']);
20+
if (!isset($where['guard_name']) || !$where['guard_name']) {
21+
$where['guard_name'] = 'admin';
22+
}
23+
1924
$navigation = Navigation::query()
20-
->where(request_intersect(['type']))
21-
->where('guard_name', $request->input('guard_name', 'admin'))
25+
->where($where)
2226
->orderBy('sequence', 'desc')
2327
->get()
2428
->toJson();

0 commit comments

Comments
 (0)