From 86e489fe86097604e31da749e02830a8efde9ef5 Mon Sep 17 00:00:00 2001 From: usersatoshi Date: Sun, 12 Nov 2023 12:45:00 +0530 Subject: [PATCH] fix --- src/functions/database/userLeaderBoard.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/functions/database/userLeaderBoard.js b/src/functions/database/userLeaderBoard.js index 7e2de583f..8f30d936a 100644 --- a/src/functions/database/userLeaderBoard.js +++ b/src/functions/database/userLeaderBoard.js @@ -26,16 +26,18 @@ module.exports = async (d) => { let value; let content = []; - const px = page * list - list, + const px = (page-1) * list, py = page * list; - all = all.slice(px, py); - let y = px; - for (const Data of all.sort((x, y) => { + all = all.sort((x, y) => { if (d.client.db.type === "aoi.db") return Number(y.value) - Number(x.value); else return Number(y.data.value) - Number(x.data.value); - })) { + }); + all = all.slice(px, py); + let y = px+1; + + for (const Data of all ) { let user; if (d.client.db.type === "aoi.db") value = Number(Data.value);