MDL-55043 core_competency: Set proper sort order for each field

This commit is contained in:
Rajesh Taneja 2016-07-04 13:01:17 +08:00
parent ac8d6cff54
commit 2648dddd2a

View File

@ -312,8 +312,10 @@ class evidence extends persistent {
if (!empty($sort)) {
$sortcolumns = explode(',', $sort);
$sortcolumns = array_map('trim', $sortcolumns);
$sort = ' ORDER BY e.' . implode(', e.', $sortcolumns) . ' ' . $order;
array_walk($sortcolumns, function(&$sortcolumn, $key, $order) {
$sortcolumn = trim($sortcolumn) . ' ' . $order;
}, $order);
$sort = ' ORDER BY e.' . implode(', e.', $sortcolumns);
}
$sql = 'SELECT e.*