add projet

This commit is contained in:
root
2026-03-05 12:29:37 -05:00
parent 8d1eef8ba8
commit 23b7db1107
9109 changed files with 1106501 additions and 73 deletions
+40
View File
@@ -0,0 +1,40 @@
<?php
namespace App\Models;
use App\Models\BaseModel;
class FinalScore extends BaseModel
{
protected $table = 'final_score';
protected $primaryKey = 'id';
protected $useAutoIncrement = true;
protected $fillable = [
'student_id',
'school_id',
'class_section_id',
'updated_by',
'score',
'score_letter',
'comment',
'school_year',
'created_at',
'updated_at',
'semester',
];
public $timestamps = true;
// Function to get the final exam score for a specific student, semester, and school year
public function getFinalExamScore($studentId, $semester, $schoolYear)
{
// Query the final_score table for the final exam score based on student ID, semester, and school year
$result = $this->select('score') // We only need the score
->where('student_id', $studentId)
->where('semester', $semester)
->where('school_year', $schoolYear)
->first(); // Get the first matching result
// Return the score, or null if no result is found
return $result ? $result['score'] : null;
}
}