Browse Source

new tops fix

master
gsd 1 year ago
parent
commit
a335bd6842
  1. 2
      src/main/java/app/services/db/KillfeedService.java

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

@ -52,7 +52,7 @@ public class KillfeedService {
}
public List<TopInFeed> getTopDeads(String server_id) {
List<TopInFeed> 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<TopInFeed> 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();

Loading…
Cancel
Save