label with code and fix bug with search null country
Some checks are pending
deploy / deploy (push) Waiting to run

This commit is contained in:
2024-01-03 22:03:13 +01:00
parent 9d98ad7a10
commit 33219a4d88
2 changed files with 5 additions and 5 deletions

View File

@@ -31,9 +31,9 @@ class IkeaProducts extends Model
if ($country != '') $result = $result->where('country',$country);
return $result->get();
} else if (strlen($item >= 5)) {
if ($country != '') $result = $this->where('country',$country);
$result = $result->where(function ($query) use ($item) { $query->where('typeName', 'LIKE', '%' . $item . '%')->orWhere('name', 'LIKE', '%' . $item . '%'); } );
$result = $this->where(function ($query) use ($item) { $query->where('typeName', 'LIKE', '%' . $item . '%')->orWhere('name', 'LIKE', '%' . $item . '%'); } );
if ($country != '') $result = $result->where('country',$country);
return $result->get();
}