From f0acd8c7edfde38dcdeb2f388dbffdb76ca9c597 Mon Sep 17 00:00:00 2001 From: Irwan Cahyono Date: Wed, 15 Jul 2026 10:41:27 +0700 Subject: [PATCH 1/2] dashboard komoditas --- app/Http/Controllers/Web/Dashboard/ProfilPetaniController.php | 2 +- app/Http/Controllers/Web/Dashboard/SurveyPetaniController.php | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/app/Http/Controllers/Web/Dashboard/ProfilPetaniController.php b/app/Http/Controllers/Web/Dashboard/ProfilPetaniController.php index 8e25ae8..dd154e5 100644 --- a/app/Http/Controllers/Web/Dashboard/ProfilPetaniController.php +++ b/app/Http/Controllers/Web/Dashboard/ProfilPetaniController.php @@ -22,7 +22,7 @@ class ProfilPetaniController extends Controller } $title = 'Dashboard Profil Petani'; - $komoditas = Komoditas::all(); + $komoditas = Komoditas::where('is_utama', true)->get(); $petani = Petani::pluck('id'); $lahan = Lahan::whereIn('petani_id', $petani)->get(); diff --git a/app/Http/Controllers/Web/Dashboard/SurveyPetaniController.php b/app/Http/Controllers/Web/Dashboard/SurveyPetaniController.php index eaf892c..3c3042e 100644 --- a/app/Http/Controllers/Web/Dashboard/SurveyPetaniController.php +++ b/app/Http/Controllers/Web/Dashboard/SurveyPetaniController.php @@ -57,6 +57,7 @@ class SurveyPetaniController extends Controller ->leftJoin("{$komoditasTable} as k", 'k.id', '=', 'p.komoditas_id') ->selectRaw("COALESCE(k.nama, 'Belum ditentukan') as nama") ->selectRaw('COUNT(p.id) as petani_count') + ->where('k.is_utama', true) ->groupBy('k.id', 'k.nama') ->orderByDesc('petani_count') ->get(); @@ -155,6 +156,7 @@ class SurveyPetaniController extends Controller ->leftJoin("{$komoditasTable} as k", 'k.id', '=', 'p.komoditas_id') ->selectRaw("COALESCE(k.nama, 'Belum ditentukan') as label") ->selectRaw('COALESCE(SUM(l.jumlah_tanaman), 0) as total') + ->where('k.is_utama', true) ->groupBy('k.id', 'k.nama') ->orderByDesc('total') ->get(); From 62f0f1bdbcf6b215ef00abb78ff63d0379a33275 Mon Sep 17 00:00:00 2001 From: Irwan Cahyono Date: Wed, 15 Jul 2026 10:55:11 +0700 Subject: [PATCH 2/2] tgl lahir edit --- resources/views/produktivitas/petani/edit.blade.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/resources/views/produktivitas/petani/edit.blade.php b/resources/views/produktivitas/petani/edit.blade.php index 38f9d95..f7f8c64 100644 --- a/resources/views/produktivitas/petani/edit.blade.php +++ b/resources/views/produktivitas/petani/edit.blade.php @@ -83,9 +83,9 @@ @error('tempat_lahir')
{{ $message }}
@enderror
- - + + @error('tanggal_lahir')
{{ $message }}
@enderror