fix db tables to have school year

This commit is contained in:
root
2026-07-12 01:02:04 -04:00
parent ed11cccecc
commit ec9fca8c45
42 changed files with 988 additions and 195 deletions
+5 -8
View File
@@ -21,8 +21,7 @@ class MessageModel extends Model
'priority',
'attachment',
'status',
'semester', // Added field
'school_year' // Added field
'semester'
];
protected $useTimestamps = false; // Since you're manually handling date fields
@@ -150,10 +149,8 @@ class MessageModel extends Model
*/
public function getMessagesBySemesterAndYear($semester, $school_year = null)
{
$builder = $this->where('semester', $semester);
if ($school_year) {
$builder->where('school_year', $school_year);
}
return $builder->orderBy('sent_datetime', 'DESC')->findAll();
return $this->where('semester', $semester)
->orderBy('sent_datetime', 'DESC')
->findAll();
}
}
}