From 46682004bfbb3c65d59f099ce0ac88ff509e8149 Mon Sep 17 00:00:00 2001 From: gsd Date: Sun, 5 Nov 2023 15:37:47 +0300 Subject: [PATCH] new db update 3 fix --- src/main/java/app/services/db/KillfeedService.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/app/services/db/KillfeedService.java b/src/main/java/app/services/db/KillfeedService.java index 63fcdfb..1fa64fe 100644 --- a/src/main/java/app/services/db/KillfeedService.java +++ b/src/main/java/app/services/db/KillfeedService.java @@ -59,7 +59,7 @@ public class KillfeedService { } public Map getPopulateWeapons(SteamID steamID, String server_id, int offset, int limit) { - List result = entityManager.createNativeQuery("SELECT COUNT(u.`weapon_index`) as c, i.`name` FROM `user_killfeed` as u INNER JOIN `tf2idb`.`tf2idb_item` as i ON u.`weapon_index` = i.`id` WHERE u.`attacker_id` = ?1 AND `attacker_id` != `victim_id` AND u.server_id like ?2 GROUP BY u.`weapon_index` DESC ORDER BY `c` DESC LIMIT ?3 OFFSET ?4") + List result = entityManager.createNativeQuery("SELECT COUNT(u.`weapon_index`) as c, i.`name`, u.`server_id` FROM `user_killfeed` as u INNER JOIN `tf2idb`.`tf2idb_item` as i ON u.`weapon_index` = i.`id` WHERE u.`attacker_id` = ?1 AND `attacker_id` != `victim_id` AND u.server_id like ?2 GROUP BY u.`weapon_index` DESC ORDER BY `c` DESC LIMIT ?3 OFFSET ?4") .setParameter(1, steamID.account_id) .setParameter(2, server_id==null||server_id.isEmpty()?'%':server_id) .setParameter(3, limit) @@ -118,9 +118,11 @@ public class KillfeedService { class HypeWeapons { long count; String name; + String server_id; HypeWeapons(Object obj) { this.count = (long) ((Object[]) obj)[0]; this.name = (String) ((Object[]) obj)[1]; + this.server_id = (String) ((Object[]) obj)[2]; } }