diff --git a/src/DB/Codeigniter4Adapter.php b/src/DB/Codeigniter4Adapter.php index 7b1fcd9..1f6f881 100644 --- a/src/DB/Codeigniter4Adapter.php +++ b/src/DB/Codeigniter4Adapter.php @@ -2,6 +2,7 @@ namespace Ozdemir\Datatables\DB; +use Ozdemir\Datatables\Column; use Ozdemir\Datatables\Iterators\ColumnCollection; use Ozdemir\Datatables\Query; @@ -97,4 +98,19 @@ public function getQueryString($query): string return $query; } + + /** + * @param Query $query + * @param Column $column + * @param $word + * @return string + */ + public function makeLikeString(Query $query, Column $column, string $word) + { + if ($this->db->getPlatform() == 'Postgre') { + return $column->name.'::TEXT ILIKE '.$this->escape('%'.$word.'%', $query); + } + + return $column->name.' LIKE '.$this->escape('%'.$word.'%', $query); + } }