From ba1a318d096d48de8290b3160771131db692e99d Mon Sep 17 00:00:00 2001 From: Irwan Cahyono Date: Fri, 7 Aug 2026 15:00:30 +0700 Subject: [PATCH] soft deleted petani --- .../Controllers/Web/Dashboard/IndeksPetaniController.php | 6 ++++++ routes/web.php | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/app/Http/Controllers/Web/Dashboard/IndeksPetaniController.php b/app/Http/Controllers/Web/Dashboard/IndeksPetaniController.php index 798f856..4fbe6e3 100644 --- a/app/Http/Controllers/Web/Dashboard/IndeksPetaniController.php +++ b/app/Http/Controllers/Web/Dashboard/IndeksPetaniController.php @@ -45,6 +45,7 @@ class IndeksPetaniController extends Controller $avgSkor = SkorPetani::query() ->join('petani', 'petani_skor.petani_id', '=', 'petani.id') + ->whereNull('petani.deleted_at') ->whereIn('petani.komoditas_id', $komoditas->pluck('id')) ->avg('skor_kesiapan_adopsi'); @@ -72,6 +73,7 @@ class IndeksPetaniController extends Controller $countSegmentasiByKomoditas = SkorPetani::query() ->join('petani', 'petani_skor.petani_id', '=', 'petani.id') + ->whereNull('petani.deleted_at') ->selectRaw(" petani.komoditas_id, $case AS segmen, @@ -83,6 +85,7 @@ class IndeksPetaniController extends Controller $avgDimensi = SkorPetani::query() ->join('petani', 'petani_skor.petani_id', '=', 'petani.id') + ->whereNull('petani.deleted_at') ->whereIn('petani.komoditas_id', $komoditas->pluck('id')) ->selectRaw(" avg(skor_d2_sistem_praktik_budidaya) as skor_d2_sistem_praktik_budidaya, @@ -92,6 +95,7 @@ class IndeksPetaniController extends Controller $avgKomponen = SkorPetani::query() ->join('petani', 'petani_skor.petani_id', '=', 'petani.id') + ->whereNull('petani.deleted_at') ->whereIn('petani.komoditas_id', $komoditas->pluck('id')) ->selectRaw("avg(skor_komp_1_d4_k3_motivasi_kapasitas_adopsi) as skor_komp_1_d4_k3_motivasi_kapasitas_adopsi, avg(skor_komp_2_d4_k2_ekonomi_rumah_tangga) as skor_komp_2_d4_k2_ekonomi_rumah_tangga, @@ -123,6 +127,7 @@ class IndeksPetaniController extends Controller $mapSegmentasi = SkorPetani::query() ->join('petani', 'petani_skor.petani_id', '=', 'petani.id') + ->whereNull('petani.deleted_at') ->selectRaw("petani.desa_kelurahan_id, $case AS segmen, COUNT(petani.id) AS total @@ -133,6 +138,7 @@ class IndeksPetaniController extends Controller $mapAvgSkorSegmentasi = SkorPetani::query() ->join('petani', 'petani_skor.petani_id', '=', 'petani.id') + ->whereNull('petani.deleted_at') ->selectRaw("petani.desa_kelurahan_id, COUNT(petani.id) AS jumlah_petani, avg(skor_kesiapan_adopsi) AS skor, diff --git a/routes/web.php b/routes/web.php index aacd6db..3558b0d 100644 --- a/routes/web.php +++ b/routes/web.php @@ -48,7 +48,7 @@ Route::middleware('auth') Route::get('/dashboard/bumdes', [App\Http\Controllers\Web\Bumdes\PengurusBumdesController::class, 'index'])->name('dashboard.bumdes'); Route::get('/dashboard/petani/demografi', [App\Http\Controllers\Web\Dashboard\DemografiPetaniController::class, 'index'])->name('dashboard.demografi-petani'); - Route::get('/dashboard/indeks-petani', [App\Http\Controllers\Web\Dashboard\IndeksPetaniController::class, 'index'])->name('dashboard.indeks-petani'); + Route::get('/dashboard/petani/indeks', [App\Http\Controllers\Web\Dashboard\IndeksPetaniController::class, 'index'])->name('dashboard.indeks-petani'); Route::get('/user-profile', [App\Http\Controllers\Web\Konfigurasi\ProfileController::class, 'index'])->name('userProfile.index'); Route::get('/user-profile/security', [App\Http\Controllers\Web\Konfigurasi\ProfileController::class, 'security'])->name('userProfile.security');