From 8caf6623f10296167f4e27fb7464607fe3345a64 Mon Sep 17 00:00:00 2001 From: snipe Date: Tue, 23 May 2017 01:09:03 -0700 Subject: [PATCH] Filter by dept for user display --- app/Http/Controllers/Api/UsersController.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/Http/Controllers/Api/UsersController.php b/app/Http/Controllers/Api/UsersController.php index c341ee1309..a31ffa0ef4 100644 --- a/app/Http/Controllers/Api/UsersController.php +++ b/app/Http/Controllers/Api/UsersController.php @@ -52,6 +52,10 @@ class UsersController extends Controller $users = $users->where('company_id','=',$request->input('company_id')); } + if ($request->has('department_id')) { + $users = $users->where('department_id','=',$request->input('department_id')); + } + $order = $request->input('order') === 'asc' ? 'asc' : 'desc'; $offset = request('offset', 0); $limit = request('limit', 50);