MDL-8569 - mod/data sorting by numerical field now works with PostgreSQL

Author: Luke Hudson <[email protected]>
This commit is contained in:
cataluke
2007-04-18 02:17:00 +00:00
parent bc1f84e618
commit 485726e71f
+2 -2
View File
@@ -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 {