Skip to content

Commit e88af3e

Browse files
committed
Implement Nicky his feedback
1 parent 54aa41f commit e88af3e

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

webapp/src/Controller/Team/MiscController.php

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,8 @@ public function homeAction(Request $request): Response
9292
paginated: false
9393
)[0];
9494

95-
$qb = $this->em->createQueryBuilder()
95+
/** @var Clarification[] $clarifications */
96+
$clarifications = $this->em->createQueryBuilder()
9697
->from(Clarification::class, 'c')
9798
->leftJoin('c.problem', 'p')
9899
->leftJoin('c.sender', 's')
@@ -101,17 +102,14 @@ public function homeAction(Request $request): Response
101102
->andWhere('c.contest = :contest')
102103
->andWhere('c.sender IS NULL')
103104
->andWhere('c.recipient = :team OR c.recipient IS NULL')
105+
->andWhere('c.submittime <= :time')
104106
->setParameter('contest', $contest)
105107
->setParameter('team', $team)
108+
->setparameter('time', time())
106109
->addOrderBy('c.submittime', 'DESC')
107110
->addOrderBy('c.clarid', 'DESC');
108-
if (!$this->dj->checkrole('jury')) {
109-
$qb->andWhere('c.submittime <= :time')
110-
->setparameter('time', time());
111-
}
112-
113-
/** @var Clarification[] $clarifications */
114-
$clarifications = $qb->getQuery()->getResult();
111+
->getQuery()
112+
->getResult();
115113

116114
/** @var Clarification[] $clarificationRequests */
117115
$clarificationRequests = $this->em->createQueryBuilder()

0 commit comments

Comments
 (0)