Browse Source

posgres support 8

master
gsd 6 months ago
parent
commit
08be42b2df
  1. 6
      src/main/java/app/services/db/KillfeedService.java

6
src/main/java/app/services/db/KillfeedService.java

@ -42,7 +42,7 @@ public class KillfeedService {
}
public List<TopInFeed> getTopKills(String server_id) {
return jdbcTemplate.query("SELECT attacker_id, count(*) as c, server_id FROM user_killfeed WHERE victim_id != attacker_id AND attacker_id != 0 AND server_id LIKE ? GROUP BY attacker_id ORDER BY c DESC LIMIT 10",
return jdbcTemplate.query("SELECT attacker_id, count(*) as c, server_id FROM user_killfeed WHERE victim_id != attacker_id AND attacker_id != 0 AND server_id LIKE ? GROUP BY attacker_id, server_id ORDER BY c DESC LIMIT 10",
new Object[]{server_id == null || server_id.isEmpty() ? "%" : server_id},
(rs, n) -> new TopInFeed(rs).setNicknames(nicknameService));
}
@ -55,7 +55,7 @@ public class KillfeedService {
}
public List<TopInFeed> getTopDeads(String server_id) {
return jdbcTemplate.query("SELECT victim_id, count(id) as c, server_id FROM user_killfeed WHERE victim_id != attacker_id AND victim_id != 0 AND server_id LIKE ? GROUP BY victim_id ORDER BY c DESC LIMIT 10",
return jdbcTemplate.query("SELECT victim_id, count(id) as c, server_id FROM user_killfeed WHERE victim_id != attacker_id AND victim_id != 0 AND server_id LIKE ? GROUP BY victim_id, server_id ORDER BY c DESC LIMIT 10",
new Object[]{ server_id == null || server_id.isEmpty() ? "%" : server_id},
(rs, n) -> new TopInFeed(rs).setNicknames(nicknameService));
}
@ -75,7 +75,7 @@ public class KillfeedService {
}
public Map getPopulateWeapons(SteamID steamID, String server_id, int offset, int limit) {
List<HypeWeapons> result = jdbcTemplate.query("SELECT COUNT(u.weapon_index) as c, i.name, u.server_id, u.weapon_classname FROM user_killfeed as u INNER JOIN tf2idb.tf2idb_item as i ON u.weapon_index = i.id WHERE u.attacker_id = ? AND attacker_id != victim_id AND u.server_id like ? GROUP BY u.weapon_index ORDER BY c DESC LIMIT ? OFFSET ?",
List<HypeWeapons> result = jdbcTemplate.query("SELECT COUNT(u.weapon_index) as c, i.name, u.server_id, u.weapon_classname FROM user_killfeed as u INNER JOIN tf2idb.tf2idb_item as i ON u.weapon_index = i.id WHERE u.attacker_id = ? AND attacker_id != victim_id AND u.server_id like ? GROUP BY u.weapon_index, i.name, u.server_id, u.weapon_classname ORDER BY c DESC LIMIT ? OFFSET ?",
new Object[]{ steamID.account_id, server_id==null||server_id.isEmpty()?"%":server_id, limit, offset },
(rs, n) -> new HypeWeapons(rs));

Loading…
Cancel
Save