fix gitlab tests

This commit is contained in:
root
2026-06-09 02:32:58 -04:00
parent 20a0b6c4e5
commit 6def9993da
1489 changed files with 10449 additions and 11356 deletions
@@ -8,8 +8,8 @@ use App\Models\Configuration;
use App\Models\TeacherClass;
use App\Models\User;
use App\Services\SchoolYears\SchoolYearContextService;
use Illuminate\Contracts\Pagination\LengthAwarePaginator;
use Illuminate\Support\Facades\Schema;
use Illuminate\Contracts\Pagination\LengthAwarePaginator;
class ClassProgressQueryService
{
@@ -28,7 +28,7 @@ class ClassProgressQueryService
->with(['classSection', 'teacher'])
->orderBy($filters['sort_by'] ?? 'week_start', $filters['sort_dir'] ?? 'desc');
if (! $this->isAdmin($user)) {
if (!$this->isAdmin($user)) {
$relaxedSectionIds = TeacherClass::distinctSectionIdsForTeacher((int) $user->id);
if (! empty($filters['class_section_id'])) {
@@ -50,31 +50,31 @@ class ClassProgressQueryService
$query->where('teacher_id', (int) $filters['teacher_id']);
}
if (! empty($filters['class_section_id'])) {
if (!empty($filters['class_section_id'])) {
$query->where('class_section_id', (int) $filters['class_section_id']);
}
if (! empty($filters['subject'])) {
if (!empty($filters['subject'])) {
$query->where('subject', (string) $filters['subject']);
}
if (! empty($filters['status'])) {
if (!empty($filters['status'])) {
$query->where('status', (string) $filters['status']);
}
if (! empty($filters['school_year']) && Schema::hasColumn('class_progress_reports', 'school_year')) {
if (!empty($filters['school_year']) && Schema::hasColumn('class_progress_reports', 'school_year')) {
$query->where('school_year', (string) $filters['school_year']);
}
if (! empty($filters['semester']) && Schema::hasColumn('class_progress_reports', 'semester')) {
if (!empty($filters['semester']) && Schema::hasColumn('class_progress_reports', 'semester')) {
$query->where('semester', (string) $filters['semester']);
}
if (! empty($filters['week_start'])) {
if (!empty($filters['week_start'])) {
$query->whereDate('week_start', '>=', $filters['week_start']);
}
if (! empty($filters['week_end'])) {
if (!empty($filters['week_end'])) {
$query->whereDate('week_end', '<=', $filters['week_end']);
}
@@ -114,7 +114,6 @@ class ClassProgressQueryService
return $rows->map(function (ClassProgressReport $row) use ($attachments) {
$row->setAttribute('status_label', $this->statusLabel($row->status));
$row->setAttribute('attachments', $attachments[$row->id] ?? []);
return $row;
})->all();
}
@@ -160,7 +159,6 @@ class ClassProgressQueryService
private function statusLabel(?string $status): string
{
$options = (array) config('progress.status_options', []);
return $options[$status] ?? 'Unknown';
}