This commit is contained in:
@@ -54,6 +54,11 @@ class CompetitionWinnersController extends BaseController
|
||||
public function index()
|
||||
{
|
||||
$competitionModel = new CompetitionModel();
|
||||
$schoolYear = $this->currentCompetitionSchoolYear();
|
||||
|
||||
if ($schoolYear !== '') {
|
||||
$competitionModel->where('school_year', $schoolYear);
|
||||
}
|
||||
|
||||
$competitions = $competitionModel
|
||||
->orderBy('id', 'DESC')
|
||||
@@ -62,12 +67,13 @@ class CompetitionWinnersController extends BaseController
|
||||
return view('admin/competition_winners/index', [
|
||||
'competitions' => $competitions,
|
||||
'sectionMap' => $this->getClassSectionMap(),
|
||||
'schoolYear' => $schoolYear,
|
||||
]);
|
||||
}
|
||||
|
||||
public function create()
|
||||
{
|
||||
$schoolYear = $this->configModel->getConfig('school_year');
|
||||
$schoolYear = $this->currentCompetitionSchoolYear();
|
||||
$classCounts = $this->getClassStudentCounts($schoolYear);
|
||||
$classSections = $this->classSectionModel
|
||||
->orderBy('class_section_name', 'ASC')
|
||||
@@ -1088,6 +1094,11 @@ class CompetitionWinnersController extends BaseController
|
||||
return $questionCounts;
|
||||
}
|
||||
|
||||
private function currentCompetitionSchoolYear(): string
|
||||
{
|
||||
return $this->currentSchoolYearName((string) ($this->configModel->getConfig('school_year') ?? ''));
|
||||
}
|
||||
|
||||
private function getClassSectionMap(): array
|
||||
{
|
||||
$sections = $this->classSectionModel
|
||||
|
||||
Reference in New Issue
Block a user