mirror of
https://github.com/snipe/snipe-it.git
synced 2025-01-11 13:57:41 -08:00
Fixes #4294 - pass correct group ID for group user listings
This commit is contained in:
parent
c18220069d
commit
7d64ab3158
|
@ -67,7 +67,7 @@ class UsersController extends Controller
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($request->has('group_id')) {
|
if ($request->has('group_id')) {
|
||||||
$users = $users->ByGroup($request->has('group_id'));
|
$users = $users->ByGroup($request->get('group_id'));
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($request->has('department_id')) {
|
if ($request->has('department_id')) {
|
||||||
|
|
|
@ -381,7 +381,7 @@ class User extends SnipeModel implements AuthenticatableContract, CanResetPasswo
|
||||||
|
|
||||||
public function scopeByGroup($query, $id) {
|
public function scopeByGroup($query, $id) {
|
||||||
return $query->whereHas('groups', function ($query) use ($id) {
|
return $query->whereHas('groups', function ($query) use ($id) {
|
||||||
$query->where('id', '=', $id);
|
$query->where('groups.id', '=', $id);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue