highscores sorted by name secondarily
This commit is contained in:
@@ -15,7 +15,7 @@ $offset = isset($_GET['offset']) ? $_GET['offset'] : 0;
|
||||
$db = new Database();
|
||||
|
||||
if($cid == -1) {
|
||||
$overview = $db->query('SELECT "name", "highscore" FROM "Users" ORDER BY "highscore" DESC
|
||||
$overview = $db->query('SELECT "name", "highscore" FROM "Users" ORDER BY "highscore" DESC, "name" ASC
|
||||
LIMIT $1 OFFSET $2', array($limit, $offset))['data'];
|
||||
foreach($overview as $row) {
|
||||
$name = $row['name'];
|
||||
@@ -24,11 +24,6 @@ if($cid == -1) {
|
||||
$data[] = array('place' => $place, 'name' => $name, 'score' => $score);
|
||||
}
|
||||
} else {
|
||||
/*$overview = $db->query('SELECT u."name", COALESCE(h."score", -1) AS "score"
|
||||
FROM "Users" u RIGHT OUTER JOIN "Highscores" h ON u."ID" = h."Users_ID"
|
||||
WHERE h."Categories_ID" = $1
|
||||
ORDER BY COALESCE(h."score", -1) DESC
|
||||
LIMIT $2 OFFSET $3', array($cid, $limit, $offset))['data'];*/
|
||||
$overview = $db->query('SELECT u."name", COALESCE(h."score", -1) AS "c_score"
|
||||
FROM "Users" u LEFT OUTER JOIN
|
||||
(SELECT "Users_ID", "score"
|
||||
|
||||
Reference in New Issue
Block a user