partial fix for teacher class progress
API CI/CD / Validate (composer + pint) (push) Successful in 3m9s
API CI/CD / Test (PHPUnit) (push) Failing after 5m6s
API CI/CD / Build frontend assets (push) Successful in 1m2s
API CI/CD / Security audit (push) Failing after 49s
API CI/CD / Deploy to shared hosting (PHP) (push) Has been skipped

This commit is contained in:
root
2026-07-07 22:02:42 -04:00
parent c891a82012
commit 21c9322127
5 changed files with 137 additions and 7 deletions
+6 -2
View File
@@ -10,7 +10,7 @@ class SubjectCurriculum extends BaseModel
{
protected $table = 'subject_curriculum_items';
protected $fillable = ['class_id', 'subject', 'unit_number', 'unit_title', 'chapter_name', 'created_at', 'updated_at'];
protected $fillable = ['class_id', 'school_year', 'subject', 'unit_number', 'unit_title', 'chapter_name', 'created_at', 'updated_at'];
public $timestamps = true;
@@ -54,7 +54,11 @@ class SubjectCurriculum extends BaseModel
return $q;
}
return $q->where('school_year', $schoolYear);
return $q->where(function (Builder $yearQuery) use ($schoolYear) {
$yearQuery->where('school_year', $schoolYear)
->orWhereNull('school_year')
->orWhere('school_year', '');
});
}
public function scopeOrdered(Builder $q): Builder