Fixes #4294 - pass correct group ID for group user listings

This commit is contained in:
snipe 2017-10-24 04:39:47 -07:00
parent c18220069d
commit 7d64ab3158
2 changed files with 2 additions and 2 deletions

View file

@ -67,7 +67,7 @@ class UsersController extends Controller
}
if ($request->has('group_id')) {
$users = $users->ByGroup($request->has('group_id'));
$users = $users->ByGroup($request->get('group_id'));
}
if ($request->has('department_id')) {

View file

@ -381,7 +381,7 @@ class User extends SnipeModel implements AuthenticatableContract, CanResetPasswo
public function scopeByGroup($query, $id) {
return $query->whereHas('groups', function ($query) use ($id) {
$query->where('id', '=', $id);
$query->where('groups.id', '=', $id);
});
}