Skip to content
This repository was archived by the owner on Mar 3, 2020. It is now read-only.

Commit 285a4f7

Browse files
committed
Fixed SELECT * FROM teams loop
1 parent 8c3f926 commit 285a4f7

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/models/MultiTeam.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -319,17 +319,20 @@ class MultiTeam extends Team {
319319
'SELECT level_id, team_id FROM scores_log WHERE level_id IS NOT NULL ORDER BY ts',
320320
);
321321
$team_scores_awaitables = Map {};
322+
$all_teams = await self::genAllTeamsCache($refresh);
323+
322324
foreach ($scores->items() as $score) {
325+
$team = $all_teams->get(intval($score->get('team_id')));
326+
invariant($team instanceof Team, 'team should be of type Team and not null');
323327
$team_scores_awaitables->add(
324328
Pair {
325329
$score->get('level_id'),
326-
self::genTeam(intval($score->get('team_id'))),
330+
$team,
327331
},
328332
);
329333
}
330-
$team_scores = await \HH\Asio\m($team_scores_awaitables);
331334

332-
foreach ($team_scores as $level_id_key => $team) {
335+
foreach ($team_scores_awaitables as $level_id_key => $team) {
333336
if ($team->getActive() === true && $team->getVisible() === true) {
334337
$teams_by_completed_level[intval($level_id_key)][] = $team;
335338
}

0 commit comments

Comments
 (0)