fix logo circle, start email body
This commit is contained in:
@@ -1115,7 +1115,7 @@ class StudentController extends BaseController
|
||||
$builder->where('is_active', 1);
|
||||
}
|
||||
|
||||
$this->applyDistributionAgeFilter($builder, $year);
|
||||
$this->applyDistributionAgeFilter($builder, $year, 'dob');
|
||||
$rows = array_merge($rows, $builder->get()->getResultArray());
|
||||
}
|
||||
|
||||
@@ -1326,7 +1326,7 @@ class StudentController extends BaseController
|
||||
$builder->where('is_active', 1);
|
||||
}
|
||||
|
||||
$this->applyDistributionAgeFilter($builder, $year);
|
||||
$this->applyDistributionAgeFilter($builder, $year, 'dob');
|
||||
$rows = $builder
|
||||
->orderBy('lastname', 'ASC')
|
||||
->orderBy('firstname', 'ASC')
|
||||
@@ -2138,14 +2138,14 @@ class StudentController extends BaseController
|
||||
return $out;
|
||||
}
|
||||
|
||||
private function applyDistributionAgeFilter($builder, string $schoolYear): void
|
||||
private function applyDistributionAgeFilter($builder, string $schoolYear, string $dobColumn = 'students.dob'): void
|
||||
{
|
||||
[$earliestDob, $latestDob] = $this->distributionAgeBirthDateWindow($schoolYear);
|
||||
|
||||
$builder
|
||||
->where('students.dob IS NOT NULL', null, false)
|
||||
->where('students.dob >=', $earliestDob)
|
||||
->where('students.dob <=', $latestDob);
|
||||
->where($dobColumn . ' IS NOT NULL', null, false)
|
||||
->where($dobColumn . ' >=', $earliestDob)
|
||||
->where($dobColumn . ' <=', $latestDob);
|
||||
}
|
||||
|
||||
private function distributionAgeBirthDateWindow(string $schoolYear): array
|
||||
|
||||
Reference in New Issue
Block a user