initial commit

This commit is contained in:
2026-09-23 12:45:02 +07:00
parent d16f454083
commit 507fc6ccdf
235 changed files with 19587 additions and 2835 deletions
+7 -8
View File
@@ -74,17 +74,16 @@ class ReportController extends Controller
protected function applyModuleFilters($query, $request, $module)
{
$status = $request->status;
$status = $request->status;
// TAMBAHAN: Logika Filter untuk Modul Cats (Sehat/Sakit)
// Ini yang membuat filter status di populasi kucing bekerja
// PERBAIKAN 1: Gunakan $request->filled('status') sesuai dengan <select name="status"> di Blade
if ($module === 'cats' && $request->filled('status')) {
match($status) {
'sakit' => $query->whereNotNull('riwayat_sakit_terakhir')->where('riwayat_sakit_terakhir', '!=', ''),
'sehat' => $query->where(function($q) {
$q->whereNull('riwayat_sakit_terakhir')
->orWhere('riwayat_sakit_terakhir', '');
}),
// PERBAIKAN 2: Tangkap semua kemungkinan value (Bahasa Indonesia, Inggris, maupun angka)
match(strtolower($status)) {
'sakit', 'treatment', '1' => $query->where('treatment_status', 1),
'sehat', 'healthy', '2' => $query->where('treatment_status', 2),
default => null
};
}