Search on all fields, remove search in
This commit is contained in:
@@ -8,7 +8,7 @@ use Illuminate\Database\Eloquent\Model;
|
||||
class IkeaProducts extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
|
||||
|
||||
protected $table = 't_ikea_products';
|
||||
|
||||
@@ -33,14 +33,21 @@ class IkeaProducts extends Model
|
||||
$result->where('country', $country);
|
||||
}
|
||||
return $result->get();
|
||||
} else if ($field == "all") {
|
||||
if (preg_match("/0[0-9]+/", $text)) {
|
||||
$result = $this->where("code", '=',$text);
|
||||
} else
|
||||
$result = $this->where("name", 'LIKE', '%'. $text . '%')->orWhere("typeName", 'LIKE', '%'. $text . '%');
|
||||
return $result->get();
|
||||
}
|
||||
|
||||
|
||||
return [];
|
||||
}
|
||||
|
||||
protected function multisearch($codes, $countries)
|
||||
{
|
||||
//$countries = $
|
||||
// return $this->where('code',$codes)->where('country',$countries);
|
||||
// return $this->where('code',$codes)->where('country',$countries);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user