From dd87b2276389ecda42137ec8298eb77ab14a8a88 Mon Sep 17 00:00:00 2001 From: wahyun Date: Thu, 25 Jul 2024 16:50:04 +0700 Subject: [PATCH] fix: dashboard BOD budget health --- app/Http/Controllers/DashboardBoDController.php | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/app/Http/Controllers/DashboardBoDController.php b/app/Http/Controllers/DashboardBoDController.php index bf47cf8..c458ac3 100644 --- a/app/Http/Controllers/DashboardBoDController.php +++ b/app/Http/Controllers/DashboardBoDController.php @@ -288,10 +288,7 @@ class DashboardBoDController extends Controller ->pluck('id'); // arr overrun - if ($role === 'Super Admin') { - $response['data']['overrun'] = Project::where('budget_health', 'overrun') - ->count(); - } elseif ($all_project == 'true') { + if ($all_project) { $response['data']['overrun'] = Project::whereIn('divisi_id', $divisi) ->where([['budget_health', 'overrun']]) ->count(); @@ -301,10 +298,7 @@ class DashboardBoDController extends Controller ->count(); } // arr warning - if ($role === 'Super Admin') { - $response['data']['warning'] = Project::where('budget_health', 'warning') - ->count(); - } elseif ($all_project == 'true') { + if ($all_project) { $response['data']['warning'] = Project::whereIn('divisi_id', $divisi) ->where([['budget_health', 'warning']]) ->count(); @@ -314,10 +308,7 @@ class DashboardBoDController extends Controller ->count(); } // arr on-budget - if ($role === 'Super Admin') { - $response['data']['on-budget'] = Project::where('budget_health', 'on-budget') - ->count(); - } elseif ($all_project == 'true') { + if ($all_project) { $response['data']['on-budget'] = Project::whereIn('divisi_id', $divisi) ->where([['budget_health', 'on-budget']]) ->count();