Skip to content

Commit e38b45f

Browse files
committed
Get balloons when there are multiple contests active
1 parent d2a38aa commit e38b45f

File tree

1 file changed

+13
-6
lines changed

1 file changed

+13
-6
lines changed

webapp/src/Service/DOMJudgeService.php

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -435,12 +435,19 @@ public function getUpdates(): array
435435
->setParameter('cid', $contest->getCid());
436436
}
437437

438-
$freezetime = $contest->getFreezeTime();
439-
if ($freezetime !== null && !(bool)$this->config->get('show_balloons_postfreeze')) {
440-
$balloonsQuery
441-
->andWhere('s.submittime < :freeze')
442-
->setParameter('freeze', $freezetime);
443-
}
438+
if (!(bool)$this->config->get('show_balloons_postfreeze')) {
439+
$balloonsQuery->andWhere('s.submittime < co.freezetime');
440+
//leftJoin('p.contest_problems', 'cp', Join::WITH, 'co.cid = cp.contest AND p.probid = cp.problem')
441+
//$freezetime = $contest->getFreezeTime();
442+
//if ($freezetime !== null && !(bool)$this->config->get('show_balloons_postfreeze')) {
443+
// $balloonsQuery
444+
// ->andWhere('s.submittime < :freeze')
445+
// ->setParameter('freeze', $freezetime);
446+
//}
447+
}
448+
// We can now have the problem that there is no selected contest (so we should list all contests) but only active ones.
449+
$balloonsQuery->andWhere('co.deactivatetime < :now OR co.deactivatetime IS NULL')
450+
->setParameter('now', new DateTime());
444451

445452
$balloons = $balloonsQuery->getQuery()->getResult();
446453
}

0 commit comments

Comments
 (0)