Commit e29f5b4288d7eb6fc827bc2db513af2835360ac7
1 parent
bafcce80
Exists in
master
and in
1 other branch
feat✨:排行榜功能 排序规则细化
Showing
1 changed file
with
1 additions
and
1 deletions
Show diff stats
service/roomrank/dto-room.go
| @@ -117,7 +117,7 @@ func (d *RoomDetails) Less(i, j int) bool { | @@ -117,7 +117,7 @@ func (d *RoomDetails) Less(i, j int) bool { | ||
| 117 | } | 117 | } |
| 118 | // 如果是玩家之间的分数相同,则先达到该分数的玩家排名靠前 | 118 | // 如果是玩家之间的分数相同,则先达到该分数的玩家排名靠前 |
| 119 | if d.Players[i].RobotConfigId == 0 && d.Players[j].RobotConfigId == 0 { | 119 | if d.Players[i].RobotConfigId == 0 && d.Players[j].RobotConfigId == 0 { |
| 120 | - return d.Players[i].JoinTime > d.Players[j].JoinTime | 120 | + return d.Players[i].JoinTime < d.Players[j].JoinTime |
| 121 | } | 121 | } |
| 122 | return d.Players[i].Score > d.Players[j].Score | 122 | return d.Players[i].Score > d.Players[j].Score |
| 123 | } | 123 | } |