foreach ($orderByColumns as $orderByColumn => $array) {
// Get keys (table/alias) and values (sorting itself)
$table = trim(implode('', array_keys($array)));
- $sorting = trim(implode('', array_keys($array)));
+ $sorting = trim(implode('', array_values($array)));
// table/alias can be omitted
if (!empty($table)) {