This commit is contained in:
@@ -1673,14 +1673,10 @@ class StudentController extends BaseController
|
||||
|
||||
$students = [];
|
||||
if (in_array($role, ['parent', 'parent_dashboard'], true)) {
|
||||
$schoolYear = $this->currentSchoolYearName((string) ($this->schoolYear ?? ''));
|
||||
$parentId = (int)(session()->get('user_id') ?? 0);
|
||||
if ($parentId > 0) {
|
||||
$students = $this->studentModel
|
||||
->select('id, school_id, firstname, lastname')
|
||||
->where('parent_id', $parentId)
|
||||
->orderBy('lastname', 'ASC')
|
||||
->orderBy('firstname', 'ASC')
|
||||
->findAll();
|
||||
if ($parentId > 0 && $schoolYear !== '') {
|
||||
$students = $this->studentModel->getByParentAndYear($parentId, $schoolYear);
|
||||
}
|
||||
} elseif (in_array($role, ['teacher', 'teacher_assistant', 'teacher_dashboard'], true)) {
|
||||
$schoolYear = $this->currentSchoolYearName((string) ($this->schoolYear ?? ''));
|
||||
@@ -1706,7 +1702,7 @@ class StudentController extends BaseController
|
||||
)), static fn($v) => $v > 0));
|
||||
if (!empty($sectionIds)) {
|
||||
$studentClassModel = new \App\Models\StudentClassModel();
|
||||
$rows = $studentClassModel->getStudentsByClassSectionIds($sectionIds);
|
||||
$rows = $studentClassModel->getStudentsByClassSectionIds($sectionIds, $schoolYear);
|
||||
$unique = [];
|
||||
foreach ($rows as $r) {
|
||||
$sid = (int)($r['student_id'] ?? 0);
|
||||
|
||||
Reference in New Issue
Block a user