Allow for email/username search on users

This commit is contained in:
snipe 2020-07-17 12:11:32 -07:00
parent 34aa12e229
commit 799a93c46a
No known key found for this signature in database
GPG key ID: 10BFFDA3ED34B5AC

View file

@ -76,6 +76,14 @@ class UsersController extends Controller
$users = $users->where('users.location_id', '=', $request->input('location_id')); $users = $users->where('users.location_id', '=', $request->input('location_id'));
} }
if ($request->filled('email')) {
$users = $users->where('users.email', '=', $request->input('email'));
}
if ($request->filled('username')) {
$users = $users->where('users.username', '=', $request->input('username'));
}
if ($request->filled('group_id')) { if ($request->filled('group_id')) {
$users = $users->ByGroup($request->get('group_id')); $users = $users->ByGroup($request->get('group_id'));
} }