Sort last TU votes by vote and by user name

Instead of using a random secondary order, sort by the ID of the last
vote first, then by user name.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
This commit is contained in:
Lukas Fleischer 2014-02-01 17:35:21 +01:00
parent 1e9d539acf
commit 333ce08027

View file

@ -1007,7 +1007,7 @@ function last_votes_list() {
$q .= "TU_VoteInfo, Users WHERE TU_VoteInfo.ID = TU_Votes.VoteID AND ";
$q .= "TU_VoteInfo.End < UNIX_TIMESTAMP() AND ";
$q .= "Users.ID = TU_Votes.UserID AND Users.AccountTypeID = 2 ";
$q .= "GROUP BY UserID ORDER BY LastVote DESC";
$q .= "GROUP BY UserID ORDER BY LastVote DESC, UserName ASC";
$result = $dbh->query($q);
$details = array();