From 84ce71a9157af9453ec4d54e183934604b6f542d Mon Sep 17 00:00:00 2001 From: Jaroslav Drzik Date: Wed, 10 Jan 2024 19:32:09 +0100 Subject: [PATCH] search by code fix --- app/Models/IkeaProducts.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Models/IkeaProducts.php b/app/Models/IkeaProducts.php index f197bcc..d0eee1d 100644 --- a/app/Models/IkeaProducts.php +++ b/app/Models/IkeaProducts.php @@ -26,7 +26,7 @@ class IkeaProducts extends Model protected function search($field, $text, $country) { - if ((strlen($text) >= 2 && $field == "name") || (strlen($text) > 3 && $field == 'typeName')) { + 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);