MDL-8569 - mod/data sorting by numerical field now works with PostgreSQL
Author: Luke Hudson <[email protected]>
This commit is contained in:
+2
-2
@@ -295,7 +295,7 @@
|
||||
$sortcontent = $sortfield->get_sort_field();
|
||||
$sortcontentfull = $sortfield->get_sort_sql('c.'.$sortcontent);
|
||||
|
||||
$what = ' DISTINCT r.id, r.approved, r.userid, u.firstname, u.lastname, c.'.$sortcontent.' ';
|
||||
$what = ' DISTINCT r.id, r.approved, r.userid, u.firstname, u.lastname, c.'.$sortcontent.', '.$sortcontentfull.' AS _order ';
|
||||
$count = ' COUNT(DISTINCT c.recordid) ';
|
||||
$tables = $CFG->prefix.'data_content c,'.$CFG->prefix.'data_records r,'.$CFG->prefix.'data_content c1, '.$CFG->prefix.'user u ';
|
||||
$where = 'WHERE c.recordid = r.id
|
||||
@@ -303,7 +303,7 @@
|
||||
AND r.dataid = '.$data->id.'
|
||||
AND r.userid = u.id
|
||||
AND c1.recordid = r.id ';
|
||||
$sortorder = ' ORDER BY '.$sortcontentfull.' '.$order.' , r.id ASC ';
|
||||
$sortorder = ' ORDER BY _order '.$order.' , r.id ASC ';
|
||||
if ($search) {
|
||||
$searchselect = ' AND (c1.content ' . sql_ilike() . " '%$search%') "; //Be case-insensitive
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user