recreate project

This commit is contained in:
root
2026-02-10 22:11:06 -05:00
commit 663c0cdbda
10149 changed files with 1379710 additions and 0 deletions
+16
View File
@@ -0,0 +1,16 @@
<?php
namespace App\Models;
use CodeIgniter\Model;
class FamilyStudentModel extends Model {
protected $table = 'family_students';
protected $primaryKey = 'id';
protected $allowedFields = ['family_id','student_id','is_primary_home','notes'];
public function getFamiliesForStudent(int $studentId): array {
$db = \Config\Database::connect();
$sql = "SELECT f.* , fs.is_primary_home\n FROM family_students fs\n JOIN families f ON f.id = fs.family_id\n WHERE fs.student_id = ? AND f.is_active = 1\n ORDER BY fs.is_primary_home DESC, f.household_name";
return $db->query($sql, [$studentId])->getResultArray();
}
}