From de6bb4239ae5cef80a2f5715bf38769743068144 Mon Sep 17 00:00:00 2001 From: Michael Vasseur <14887731+vmcj@users.noreply.github.com> Date: Tue, 23 Jul 2024 12:36:20 +0200 Subject: [PATCH] Get same (wrong) behaviour as balloon page. --- webapp/src/Service/DOMJudgeService.php | 23 +++++------------------ 1 file changed, 5 insertions(+), 18 deletions(-) diff --git a/webapp/src/Service/DOMJudgeService.php b/webapp/src/Service/DOMJudgeService.php index 3268763f70..f9feafc4aa 100644 --- a/webapp/src/Service/DOMJudgeService.php +++ b/webapp/src/Service/DOMJudgeService.php @@ -419,35 +419,22 @@ public function getUpdates(): array } } - if ($this->checkrole('balloon')) { + if ($this->checkrole('balloon') && $contest) { $balloonsQuery = $this->em->createQueryBuilder() ->select('b.balloonid', 't.name', 't.location', 'p.name AS pname') ->from(Balloon::class, 'b') ->leftJoin('b.submission', 's') ->leftJoin('s.problem', 'p') ->leftJoin('s.contest', 'co') + ->leftJoin('p.contest_problems', 'cp', Join::WITH, 'co.cid = cp.contest AND p.probid = cp.problem') ->leftJoin('s.team', 't') + ->andWhere('co.cid = :cid') + ->setParameter('cid', $contest->getCid()) ->andWhere('b.done = 0'); - if ($contest) { - $balloonsQuery->leftJoin('p.contest_problems', 'cp', Join::WITH, 'co.cid = cp.contest AND p.probid = cp.problem') - ->andWhere('co.cid = :cid') - ->setParameter('cid', $contest->getCid()); - } - if (!(bool)$this->config->get('show_balloons_postfreeze')) { - $balloonsQuery->andWhere('s.submittime < co.freezetime'); - //leftJoin('p.contest_problems', 'cp', Join::WITH, 'co.cid = cp.contest AND p.probid = cp.problem') - //$freezetime = $contest->getFreezeTime(); - //if ($freezetime !== null && !(bool)$this->config->get('show_balloons_postfreeze')) { - // $balloonsQuery - // ->andWhere('s.submittime < :freeze') - // ->setParameter('freeze', $freezetime); - //} + $balloonsQuery->andWhere('s.submittime < co.freezetime'); } - // We can now have the problem that there is no selected contest (so we should list all contests) but only active ones. - $balloonsQuery->andWhere('co.deactivatetime < :now OR co.deactivatetime IS NULL') - ->setParameter('now', new DateTime()); $balloons = $balloonsQuery->getQuery()->getResult(); }