fix all issues before deploy
This commit is contained in:
@@ -2897,12 +2897,17 @@ class ParentController extends BaseController
|
||||
$lnKey = mb_strtolower(trim(preg_replace('/\s+/', ' ', $lastName)), 'UTF-8');
|
||||
$dobStr = $dobObj->format('Y-m-d');
|
||||
|
||||
$existing = $this->studentModel
|
||||
->where('school_year', $schoolYear)
|
||||
->where('dob', $dobStr)
|
||||
->where('firstname', $firstName) // already normalized above
|
||||
->where('lastname', $lastName) // already normalized above
|
||||
->first();
|
||||
$existingBuilder = $this->studentModel
|
||||
->where('parent_id', (int) $parentId)
|
||||
->where('dob', $dobStr)
|
||||
->where('firstname', $firstName) // already normalized above
|
||||
->where('lastname', $lastName); // already normalized above
|
||||
|
||||
if ($this->db->fieldExists('school_year', 'students')) {
|
||||
$existingBuilder->where('school_year', $schoolYear);
|
||||
}
|
||||
|
||||
$existing = $existingBuilder->first();
|
||||
|
||||
if (!$studentId && $existing) {
|
||||
session()->setFlashdata(
|
||||
|
||||
Reference in New Issue
Block a user