fix db tables to have school year
This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user