ajout de colones leaderboard

This commit is contained in:
2026-03-16 15:40:32 +01:00
parent 122480a400
commit 0074e735a8
2 changed files with 5 additions and 3 deletions

View File

@@ -137,7 +137,7 @@ public class GestionnaireBDD {
}
public Object[][] getLeaderboardData() {
String sql = "SELECT u.identifiant, p.score, p.date_partie " +
String sql = "SELECT u.identifiant, p.score, p.date_partie, p.campagne_id, p.difficulte_id " +
"FROM parties p " +
"JOIN utilisateurs u ON p.utilisateur_id = u.id " +
"ORDER BY p.score DESC LIMIT 10";
@@ -148,7 +148,9 @@ public class GestionnaireBDD {
Object[] row = {
rs.getString("identifiant"),
rs.getInt("score"),
new java.text.SimpleDateFormat("yyyy-MM-dd HH:mm").format(rs.getTimestamp("date_partie"))
new java.text.SimpleDateFormat("yyyy-MM-dd HH:mm").format(rs.getTimestamp("date_partie")),
rs.getInt("campagne_id"),
rs.getInt("difficulte_id")
};
data.add(row);
}

View File

@@ -46,7 +46,7 @@ public class MenuLeaderboard extends JPanel {
public void rafraichirLeaderboard() {
Object[][] data = jeu.bdd.getLeaderboardData();
String[] columnNames = {"Identifiant", "Score", "Date"};
String[] columnNames = {"Identifiant", "Score", "Date", "Campagne", "Difficulté"};
// Utilisation d'un DefaultTableModel pour rendre les cellules non éditables
leaderboardTable.setModel(new DefaultTableModel(data, columnNames) {
@Override