Fix search code

This commit is contained in:
2024-03-24 15:44:15 +01:00
parent c9215f456d
commit 29f1191afa

View File

@@ -27,7 +27,7 @@ class IkeaProducts extends Model
protected function search($field, $text, $country)
{
if ((strlen($text) >= 2 && $field == "name") || (strlen($text) > 3 && $field == 'typeName') || (strlen($text) == 8 && $field = 'code')) {
if ((strlen($text) >= 2 && $field == "name") || (strlen($text) > 3 && $field == 'typeName') || (strlen($text) == 8 && $field == 'code')) {
$result = $this->where($field, 'LIKE', '%' . $text . '%');
if ($country != '') {
$result->where('country', $country);