mirror of
https://github.com/amineo/t2-stat-parser.git
synced 2026-01-20 01:34:47 +00:00
Refine queries
This commit is contained in:
parent
cfa645120d
commit
982d1c429c
|
|
@ -24,8 +24,20 @@ class PlayerController {
|
|||
|
||||
// Player Detail
|
||||
async player({ inertia, request }) {
|
||||
const playerInfo = await Database.from('players').where({ player_guid: request.params.player_guid })
|
||||
const playerStatData = await Database.from('games').where({ player_guid: request.params.player_guid })
|
||||
const playerInfo = await Database.from('players')
|
||||
.distinct('player_guid',
|
||||
'player_name',
|
||||
'total_games_ctfgame',
|
||||
'total_games_dmgame',
|
||||
'total_games_lakrabbitgame',
|
||||
'total_games_sctfgame')
|
||||
.where({ player_guid: request.params.player_guid })
|
||||
|
||||
|
||||
const playerStatData = await Database.from('games')
|
||||
.select('game_id',
|
||||
'stats')
|
||||
.where({ player_guid: request.params.player_guid })
|
||||
|
||||
let playerData = {
|
||||
player: playerInfo[0],
|
||||
|
|
|
|||
Loading…
Reference in a new issue