mirror of
https://github.com/snipe/snipe-it.git
synced 2024-11-09 23:24:06 -08:00
Fix $search variable to $search_var for new filter
This commit is contained in:
parent
adddc5324b
commit
f6d8642799
|
@ -856,10 +856,10 @@ class Asset extends Depreciable
|
|||
}
|
||||
|
||||
if ($key =='checkedout_to') {
|
||||
$query->whereHas('assigneduser', function ($query) use ($search) {
|
||||
$query->where(function ($query) use ($search) {
|
||||
$query->where('users.first_name', 'LIKE', '%' . $search . '%')
|
||||
->orWhere('users.last_name', 'LIKE', '%' . $search . '%');
|
||||
$query->whereHas('assigneduser', function ($query) use ($search_val) {
|
||||
$query->where(function ($query) use ($search_val) {
|
||||
$query->where('users.first_name', 'LIKE', '%' . $search_val . '%')
|
||||
->orWhere('users.last_name', 'LIKE', '%' . $search_val . '%');
|
||||
});
|
||||
});
|
||||
}
|
||||
|
@ -876,8 +876,8 @@ class Asset extends Depreciable
|
|||
}
|
||||
|
||||
if ($key =='category') {
|
||||
$query->whereHas('model', function ($query) use ($search) {
|
||||
$query->whereHas('category', function ($query) use ($search) {
|
||||
$query->whereHas('model', function ($query) use ($search_val) {
|
||||
$query->whereHas('category', function ($query) use ($search_val) {
|
||||
$query->where(function ($query) use ($search_val) {
|
||||
$query->where('categories.name', 'LIKE', '%' . $search_val . '%')
|
||||
->orWhere('models.name', 'LIKE', '%' . $search_val . '%')
|
||||
|
|
Loading…
Reference in a new issue