From 4794f93224000e9afae45eae8838b63a7d921320 Mon Sep 17 00:00:00 2001 From: snipe Date: Tue, 31 Aug 2021 12:24:53 -0700 Subject: [PATCH] Added additional fields for user search Signed-off-by: snipe --- app/Http/Controllers/Api/UsersController.php | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/app/Http/Controllers/Api/UsersController.php b/app/Http/Controllers/Api/UsersController.php index a7e49898c3..7ab5cbaccc 100644 --- a/app/Http/Controllers/Api/UsersController.php +++ b/app/Http/Controllers/Api/UsersController.php @@ -91,6 +91,26 @@ class UsersController extends Controller $users = $users->where('users.username', '=', $request->input('username')); } + if ($request->filled('first_name')) { + $users = $users->where('users.first_name', '=', $request->input('first_name')); + } + + if ($request->filled('last_name')) { + $users = $users->where('users.last_name', '=', $request->input('last_name')); + } + + if ($request->filled('employee_num')) { + $users = $users->where('users.employee_num', '=', $request->input('employee_num')); + } + + if ($request->filled('state')) { + $users = $users->where('users.state', '=', $request->input('state')); + } + + if ($request->filled('state')) { + $users = $users->where('users.zip', '=', $request->input('zip')); + } + if ($request->filled('group_id')) { $users = $users->ByGroup($request->get('group_id')); }