From ceec403cf1be7355c39914b1129c26aa0394013d Mon Sep 17 00:00:00 2001 From: Max Leaver Date: Wed, 3 Aug 2016 11:40:10 -0400 Subject: [PATCH] Apply setColumnSearchType settings to global searches --- libraries/Datatable.php | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/libraries/Datatable.php b/libraries/Datatable.php index d7f2363..643bffd 100644 --- a/libraries/Datatable.php +++ b/libraries/Datatable.php @@ -402,14 +402,10 @@ private function sqlJoinsAndWhere() $globSearch = $f->post_get('search'); if ($globSearch['value'] !== '') { $gSearchVal = $globSearch['value']; - $sqlOr = ''; - $op = ''; foreach ($searchableColumns as $c) { - $sqlOr .= $op . $c . ' LIKE \'' . $this->CI->db->escape_like_str($gSearchVal) . '%\''; - $op = ' OR '; + $searchType = $this->getColumnSearchType($c); + $this->CI->db->or_like($c, $gSearchVal, $searchType); } - - $this->CI->db->where('(' . $sqlOr . ')'); }