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 -5
View File
@@ -6,11 +6,14 @@ use App\Models\Staff;
use App\Models\TeacherClass;
use App\Models\User;
use App\Services\System\GlobalConfigService;
use Illuminate\Contracts\Pagination\LengthAwarePaginator;
use Illuminate\Support\Facades\DB;
class StaffQueryService
{
public function __construct(private GlobalConfigService $configService) {}
public function __construct(private GlobalConfigService $configService)
{
}
public function paginate(array $filters, int $page, int $perPage): array
{
@@ -19,7 +22,7 @@ class StaffQueryService
$query = Staff::query()
->whereNotIn(DB::raw('LOWER(active_role)'), $excluded);
if (! empty($filters['role'])) {
if (!empty($filters['role'])) {
$role = strtolower(trim((string) $filters['role']));
$query->whereRaw('LOWER(active_role) = ?', [$role]);
}
@@ -44,7 +47,7 @@ class StaffQueryService
if (in_array($role, ['teacher', 'teacher_assistant'], true)) {
$tid = (int) ($staff->user_id ?? 0);
$labels = $assignByTeacher[$tid] ?? [];
if (! empty($labels)) {
if (!empty($labels)) {
$staff->class_section = implode(', ', array_unique($labels));
$staff->verification_issue = false;
} else {
@@ -98,10 +101,10 @@ class StaffQueryService
continue;
}
$pos = strtolower((string) ($row->position ?? ''));
if (! in_array($pos, ['main', 'ta'], true)) {
if (!in_array($pos, ['main', 'ta'], true)) {
continue;
}
$assignByTeacher[$tid][] = $name.' ('.$pos.')';
$assignByTeacher[$tid][] = $name . ' (' . $pos . ')';
}
return $assignByTeacher;