Open Nounours13 opened 5 years ago
private function get_filtering()
{
$mColArray = $this->ci->input->post('columns');
$sWhere = '';
$search = $this->ci->input->post('search');
$sSearch = $this->ci->db->escape_like_str(trim($search['value']));
$columns = array_values(array_diff($this->columns, $this->unset_columns));
if($sSearch != '')
for($i = 0; $i < count($mColArray); $i++)
if ($mColArray[$i]['searchable'] == 'true' && !array_key_exists($mColArray[$i]['data'], $this->add_columns))
if (!empty($mColArray[$i]['data'])) {
if($this->check_cType())
$sWhere .= $mColArray[$i]['data'] . " LIKE '%" . $sSearch . "%' OR ";
else
$sWhere .= $this->select[$this->columns[$i]] . " LIKE '%" . $sSearch . "%' OR ";
}
$sWhere = substr_replace($sWhere, '', -3);
if($sWhere != '')
$this->ci->db->where('(' . $sWhere . ')');
// TODO : sRangeSeparator
foreach($this->filter as $val)
$this->ci->db->where($val[0], $val[1], $val[2]);
}
i try to change like this, but you can't use order by on query. just use order on javascript of datatables it will ordering from server side too.
Hi, I've a projet where i must use smart search on datatable (many word on many column). If anybody have the same problem, i've change the code to this (line 327)