This commit is contained in:
Saufi
2026-05-19 09:53:36 +08:00
parent f39eca4b1c
commit b0eec13d5b
22 changed files with 1166 additions and 238 deletions

View File

@@ -40,11 +40,16 @@ class ParticipantController extends Controller
$programParticipants = $query->paginate(20)->withQueryString();
$countRow = DB::table('program_participants')
->where('program_id', $program->id)
->selectRaw("COUNT(*) as total, SUM(is_pre_registered) as pre_registered, SUM(registration_source = 'walk_in') as walk_in, SUM(status = 'checked_in') as checked_in")
->first();
$counts = [
'total' => $program->programParticipants()->count(),
'pre_registered' => $program->programParticipants()->where('is_pre_registered', true)->count(),
'walk_in' => $program->programParticipants()->where('registration_source', 'walk_in')->count(),
'checked_in' => $program->programParticipants()->where('status', 'checked_in')->count(),
'total' => (int) ($countRow->total ?? 0),
'pre_registered' => (int) ($countRow->pre_registered ?? 0),
'walk_in' => (int) ($countRow->walk_in ?? 0),
'checked_in' => (int) ($countRow->checked_in ?? 0),
];
return view('admin.programs.participants.index', compact('program', 'programParticipants', 'counts'));