fix enrollment and email send to parent
This commit is contained in:
@@ -901,6 +901,19 @@ private function applyDistributionDraftToStudentClass(int $studentId, string $ye
|
||||
return;
|
||||
}
|
||||
|
||||
$enrollment = $this->db->table('enrollments')
|
||||
->select('class_section_id')
|
||||
->where('student_id', $studentId)
|
||||
->where('school_year', $year)
|
||||
->orderBy('updated_at', 'DESC')
|
||||
->orderBy('id', 'DESC')
|
||||
->limit(1)
|
||||
->get()
|
||||
->getRowArray();
|
||||
if ((int)($enrollment['class_section_id'] ?? 0) > 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
$targetSectionId = (int)($draft['class_section_id'] ?? 0);
|
||||
if ($targetSectionId <= 0) {
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user