I found that if you are sorting on columns that have functions in the select such as CONCAT or DISTINCT it puts the functions in the where clauses. This also occurs if you alias a field. eq...( field_name as fn)
I've added this function in
private function cleanColumns( $cols )
{
//just add in more functions if you use them
//i add spaces before and after parenthesis if you do not remove the spaces below
$_search = [
'GROUP_CONCAT( ',
'CONCAT( ',
'DISTINCT( ',
',',
' )',
'as',
];
foreach ( $cols as $col )
{
$_column = explode( ' ' , str_replace( $_search, '', $col, $count ) );
if ( $count > 0 )
{
$columns[] = array_shift( $_column );
}
else
{
$columns[] = end( $_column );
}
}
return $columns;
}
then added this to the top of the filtering() function
I found that if you are sorting on columns that have functions in the select such as CONCAT or DISTINCT it puts the functions in the where clauses. This also occurs if you alias a field. eq...( field_name as fn)
I've added this function in
then added this to the top of the filtering() function
then just below
add
then in this for loop
change
also in the ordering() function just after
add
then change
in the for loop
seems to work let me know if there is a better way