Fix search code
This commit is contained in:
@@ -27,7 +27,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') || (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 . '%');
|
$result = $this->where($field, 'LIKE', '%' . $text . '%');
|
||||||
if ($country != '') {
|
if ($country != '') {
|
||||||
$result->where('country', $country);
|
$result->where('country', $country);
|
||||||
|
|||||||
Reference in New Issue
Block a user