Update Saqel Platform: 2026-09-02 00:55:56
This commit is contained in:
@@ -25,27 +25,6 @@ class GuardianController
|
||||
[$guardianId]
|
||||
);
|
||||
|
||||
// If no children linked (for demo purposes, link up to 3 students so the multi-child UI can be tested)
|
||||
if (empty($children)) {
|
||||
$demoStudents = Database::select("SELECT id FROM students LIMIT 3");
|
||||
if (!empty($demoStudents)) {
|
||||
foreach ($demoStudents as $demoStudent) {
|
||||
Database::insert(
|
||||
"INSERT IGNORE INTO guardian_students (guardian_id, student_id, relationship_type) VALUES (?, ?, 'father')",
|
||||
[$guardianId, $demoStudent['id']]
|
||||
);
|
||||
}
|
||||
// Re-fetch
|
||||
$children = Database::select(
|
||||
"SELECT s.id, s.uuid, s.full_name, s.national_id, s.grade_level, s.stream
|
||||
FROM students s
|
||||
JOIN guardian_students gs ON gs.student_id = s.id
|
||||
WHERE gs.guardian_id = ?",
|
||||
[$guardianId]
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
$dashboardData = [];
|
||||
|
||||
foreach ($children as $child) {
|
||||
|
||||
Reference in New Issue
Block a user