Highlighting user's name in the game ladder

This commit is contained in:
2019-06-11 16:53:43 +10:00
parent 162d0f4c1a
commit b714f43a59
4 changed files with 20 additions and 3 deletions
+1 -1
View File
@@ -111,7 +111,7 @@ const isSpying = (connection, user, cb) => {
const getLadderData = (connection, field, start, length, cb) => {
//moved here for reusability
let query = 'SELECT accounts.id AS id, username, soldiers, recruits, gold FROM accounts JOIN profiles ON accounts.id = profiles.accountId ORDER BY ladderRank ASC LIMIT ?, ?;';
let query = 'SELECT accounts.id AS id, username, soldiers, recruits, gold FROM accounts JOIN profiles ON accounts.id = profiles.accountId ORDER BY -ladderRank DESC LIMIT ?, ?;';
connection.query(query, [start, length], (err, results) => {
cb(err, results);
});