How set AND condition to ALL columns in datatable - server side
How set AND condition to ALL columns in datatable - server side
Dear Allan, Dear Community,
question is a little tricky.
I want AND condition to ALL columns
Look this video to dispel any doubts on what I want: LOOK
You can test the difference on this 3 tables showed in video
1st table, AND condition on a single column, server side: DEMO 1
2nd table. OR condition with full text index, server side: DEMO 2
3rd table, no server side - but THIS is I WANT but in server side: DEMO3
This php code in ssp.class.php is not right:
static function filter ( $request, $columns, &$bindings )
{
$globalSearch = array();
$columnSearch = array();
$dtColumns = self::pluck( $columns, 'dt' );
if ( isset($request['search']) && $request['search']['value'] != '' ) {
$str = $request['search']['value'];
for ( $i=0, $ien=count($request['columns']) ; $i<$ien ; $i++ ) {
$requestColumn = $request['columns'][$i];
$columnIdx = array_search( $requestColumn['data'], $dtColumns );
$column = $columns[ $columnIdx ];
if ( $requestColumn['searchable'] == 'true' ) {
$binding = self::bind( $bindings, '%'.$str.'%', PDO::PARAM_STR );
//$globalSearch[] = "match(".$column['db'].") against (".$binding.")";
$globalSearch[] = "`".$column['db']."` LIKE ".$binding;
}
}
}
I ask also on stackoverflow but unsuccesfully: stackoverflow