apply the school year concept
Tests / PHPUnit (push) Failing after 1m19s

This commit is contained in:
root
2026-07-14 00:59:00 -04:00
parent 504c3bc9f9
commit feb1b29a32
73 changed files with 4288 additions and 620 deletions
+15 -1
View File
@@ -13,6 +13,11 @@ class WinnersController extends BaseController
public function competitionIndex()
{
$competitionModel = new CompetitionModel();
$schoolYear = $this->currentSchoolYearName();
if ($schoolYear !== '') {
$competitionModel->where('school_year', $schoolYear);
}
$competitions = $competitionModel
->where('is_published', 1)
@@ -21,6 +26,7 @@ class WinnersController extends BaseController
return view('winners/competitions/index', [
'competitions' => $competitions,
'schoolYear' => $schoolYear,
]);
}
@@ -31,7 +37,14 @@ class WinnersController extends BaseController
$classSectionModel = new ClassSectionModel();
$classWinnerModel = new CompetitionClassWinnerModel();
$competition = $competitionModel->where('is_published', 1)->find($id);
$schoolYear = $this->currentSchoolYearName();
$competitionModel->where('is_published', 1);
if ($schoolYear !== '') {
$competitionModel->where('school_year', $schoolYear);
}
$competition = $competitionModel->find($id);
if (!$competition) {
return redirect()->to('/winners/competitions');
}
@@ -81,6 +94,7 @@ class WinnersController extends BaseController
'winnersByClass' => $winnersByClass,
'sectionMap' => $sectionMap,
'questionCounts' => $questionCounts,
'schoolYear' => $schoolYear,
]);
}
}