mirror of
https://github.com/vkaelin/LeagueStats.git
synced 2026-03-25 04:47:27 +00:00
feat: get more recent summoner name in mates query
This commit is contained in:
parent
83ef32054c
commit
388c14e5ac
1 changed files with 14 additions and 2 deletions
|
|
@ -224,14 +224,26 @@ class MatchRepository {
|
|||
public async mates(filters: SelectFilters) {
|
||||
const query = `
|
||||
SELECT
|
||||
(array_agg(mates.summoner_name ORDER BY mates.match_id DESC))[1] as name,
|
||||
(
|
||||
SELECT
|
||||
summoner_name
|
||||
FROM
|
||||
match_players
|
||||
WHERE
|
||||
summoner_puuid = mates.summoner_puuid
|
||||
ORDER BY
|
||||
match_id DESC
|
||||
LIMIT
|
||||
1
|
||||
) AS name,
|
||||
COUNT(match_players.id) as count,
|
||||
SUM(match_players.win) as wins,
|
||||
SUM(match_players.loss) as losses
|
||||
FROM
|
||||
match_players
|
||||
${this.JOIN_MATCHES}
|
||||
INNER JOIN match_players as mates ON match_players.match_id = mates.match_id AND match_players.team = mates.team
|
||||
INNER JOIN
|
||||
match_players as mates ON match_players.match_id = mates.match_id AND match_players.team = mates.team
|
||||
WHERE
|
||||
${this.globalFilters(filters)}
|
||||
GROUP BY
|
||||
|
|
|
|||
Loading…
Reference in a new issue