mirror of
https://github.com/snipe/snipe-it.git
synced 2024-11-10 07:34:06 -08:00
Feature - allow search on group names
This commit is contained in:
parent
25bd1acab5
commit
c47d391946
|
@ -389,6 +389,11 @@ class User extends Model implements AuthenticatableContract, CanResetPasswordCon
|
|||
$query->where('locations.name', 'LIKE', '%'.$search.'%');
|
||||
});
|
||||
})
|
||||
->orWhere(function ($query) use ($search) {
|
||||
$query->whereHas('groups', function ($query) use ($search) {
|
||||
$query->where('groups.name', 'LIKE', '%'.$search.'%');
|
||||
});
|
||||
})
|
||||
|
||||
// Ugly, ugly code because Laravel sucks at self-joins
|
||||
->orWhere(function ($query) use ($search) {
|
||||
|
|
Loading…
Reference in a new issue