search by code fix

This commit is contained in:
2024-01-10 19:32:09 +01:00
parent 416ce7964d
commit 84ce71a915

View File

@@ -26,7 +26,7 @@ class IkeaProducts extends Model
protected function search($field, $text, $country) 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 . '%'); $result = $this->where($field, 'LIKE', '%' . $text . '%');
if ($country != '') { if ($country != '') {
$result->where('country', $country); $result->where('country', $country);