Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Leaderboard Position #56

Open
mydnic opened this issue Jun 9, 2023 · 0 comments
Open

Leaderboard Position #56

mydnic opened this issue Jun 9, 2023 · 0 comments

Comments

@mydnic
Copy link

mydnic commented Jun 9, 2023

Hello!

I was wondering what would be the best approach here to get the "ranking position" of a User A in comparison to all other users.

The goal would be to display #3 next to the user's name if he's 3rd in his total points.

User X has 1 point
User Y has 1000 points
User Z has 900 Point
User A has 800 Points -> he's in 3rd position in the global users ranking.

My first thought would be to run a daily cron job to aggregate each user's points in a new column on the users table. Then query all users ordered by this column ?

Thanks in advance

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant