[DIVA] Fix ranking being reversed

This commit is contained in:
samnyan
2020-01-21 20:52:04 +08:00
parent 5fa287ffb6
commit 0f37346fdc
5 changed files with 82 additions and 5 deletions

View File

@@ -39,7 +39,9 @@ public interface PlayerPvRecordRepository extends JpaRepository<PlayerPvRecord,
List<PlayerPvRecord> findByPdIdAndEdition(PlayerProfile profile, Edition edition);
List<PlayerPvRecord> findTop3ByPvIdAndEditionAndDifficultyOrderByMaxScore(int pvId, Edition edition, Difficulty difficulty);
List<PlayerPvRecord> findTop3ByPvIdAndEditionAndDifficultyOrderByMaxScoreDesc(int pvId, Edition edition, Difficulty difficulty);
Page<PlayerPvRecord> findByPvIdAndEditionAndDifficultyOrderByMaxScoreDesc(int pvId, Edition edition, Difficulty difficulty, Pageable page);
Page<PlayerPvRecord> findByPdId_PdIdOrderByPvId(int pdId, Pageable page);

View File

@@ -59,7 +59,7 @@ public class PsRankingHandler extends BaseHandler {
for (int i :
list) {
List<PlayerPvRecord> records = playerPvRecordRepository.findTop3ByPvIdAndEditionAndDifficultyOrderByMaxScore(i, Edition.ORIGINAL, difficulty);
List<PlayerPvRecord> records = playerPvRecordRepository.findTop3ByPvIdAndEditionAndDifficultyOrderByMaxScoreDesc(i, Edition.ORIGINAL, difficulty);
resultCollections.put(i, new PsRankingCollection(i, edition, records));
}

View File

@@ -155,6 +155,7 @@ public class PlayerProfile implements Serializable {
private String myList2 = getDummyString("-1", 40);
@JsonIgnore
private int rivalPdId = -1;
public PlayerProfile(int pdId, String playerName) {