@@ -419,35 +419,22 @@ public function getUpdates(): array
419
419
}
420
420
}
421
421
422
- if ($ this ->checkrole ('balloon ' )) {
422
+ if ($ this ->checkrole ('balloon ' ) && $ contest ) {
423
423
$ balloonsQuery = $ this ->em ->createQueryBuilder ()
424
424
->select ('b.balloonid ' , 't.name ' , 't.location ' , 'p.name AS pname ' )
425
425
->from (Balloon::class, 'b ' )
426
426
->leftJoin ('b.submission ' , 's ' )
427
427
->leftJoin ('s.problem ' , 'p ' )
428
428
->leftJoin ('s.contest ' , 'co ' )
429
+ ->leftJoin ('p.contest_problems ' , 'cp ' , Join::WITH , 'co.cid = cp.contest AND p.probid = cp.problem ' )
429
430
->leftJoin ('s.team ' , 't ' )
431
+ ->andWhere ('co.cid = :cid ' )
432
+ ->setParameter ('cid ' , $ contest ->getCid ())
430
433
->andWhere ('b.done = 0 ' );
431
434
432
- if ($ contest ) {
433
- $ balloonsQuery ->leftJoin ('p.contest_problems ' , 'cp ' , Join::WITH , 'co.cid = cp.contest AND p.probid = cp.problem ' )
434
- ->andWhere ('co.cid = :cid ' )
435
- ->setParameter ('cid ' , $ contest ->getCid ());
436
- }
437
-
438
435
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
- //}
436
+ $ balloonsQuery ->andWhere ('s.submittime < co.freezetime ' );
447
437
}
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 ());
451
438
452
439
$ balloons = $ balloonsQuery ->getQuery ()->getResult ();
453
440
}
0 commit comments