From a335bd684220d33c64eff0e1d0786005224ec014 Mon Sep 17 00:00:00 2001 From: gsd Date: Sun, 5 Nov 2023 20:00:54 +0300 Subject: [PATCH] new tops fix --- src/main/java/app/services/db/KillfeedService.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/app/services/db/KillfeedService.java b/src/main/java/app/services/db/KillfeedService.java index bc5a3c9..4387a22 100644 --- a/src/main/java/app/services/db/KillfeedService.java +++ b/src/main/java/app/services/db/KillfeedService.java @@ -52,7 +52,7 @@ public class KillfeedService { } public List getTopDeads(String server_id) { - List result = entityManager.createNativeQuery("SELECT `attacker_id`, count(*) as c, `server_id` FROM `user_killfeed` WHERE `victim_id` != `attacker_id` AND `victim_id` != 0 AND `server_id` LIKE ?1 GROUP BY `victim_id` ORDER BY `c` DESC LIMIT 10") + List result = entityManager.createNativeQuery("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 ?1 GROUP BY `victim_id` ORDER BY `c` DESC LIMIT 10") .setParameter(1, server_id==null||server_id.isEmpty()?'%':server_id) .getResultStream().map(obj -> new TopInFeed(obj)).toList(); return result.stream().peek(kif -> kif.setNicknames(nicknameService)).toList();