diff --git a/app/Http/Controllers/Api/UsersController.php b/app/Http/Controllers/Api/UsersController.php index 92d763dd23..edfce18689 100644 --- a/app/Http/Controllers/Api/UsersController.php +++ b/app/Http/Controllers/Api/UsersController.php @@ -66,6 +66,8 @@ class UsersController extends Controller 'users.zip', 'users.remote', 'users.ldap_import', + 'users.start_date', + 'users.end_date', ])->with('manager', 'groups', 'userloc', 'company', 'department', 'assets', 'licenses', 'accessories', 'consumables', 'createdBy',) ->withCount('assets as assets_count', 'licenses as licenses_count', 'accessories as accessories_count', 'consumables as consumables_count'); @@ -146,6 +148,15 @@ class UsersController extends Controller $users = $users->where('remote', '=', $request->input('remote')); } + if ($request->filled('start_date')) { + $users = $users->where('users.start_date', '=', $request->input('start_date')); + } + + if ($request->filled('end_date')) { + $users = $users->where('users.end_date', '=', $request->input('end_date')); + } + + if ($request->filled('assets_count')) { $users->has('assets', '=', $request->input('assets_count')); }