Forum Discussion
VarunGrazitti
6 years agoBoss
katiepbussey - In your query, you are using ORDER BY on is_solution(weight), where is_solution is a boolean and hence won't work with weight param. Instead, following is the correct query, where it will sort messages based on whether or not they have been accepted as a solution. Descending order displays solutions first.
SELECT author FROM messages WHERE is_solution = true ORDER BY is_solution DESC LIMIT 9
You can get more details about this query here.
In addition to this, do you want to show the leaderboard with only the internal staff? In that case, since you already would have a role associated with your internal staff, so in the above query, you can also pass the same role to get them in the leaderboard.
I hope this helps.
Related Content
- 4 years ago
- 3 years ago
- 3 years ago