|
|
@ -288,7 +288,10 @@ class DashboardBoDController extends Controller |
|
|
|
->pluck('id'); |
|
|
|
->pluck('id'); |
|
|
|
|
|
|
|
|
|
|
|
// arr overrun |
|
|
|
// arr overrun |
|
|
|
if ($all_project) { |
|
|
|
if ($role === 'Super Admin') { |
|
|
|
|
|
|
|
$response['data']['overrun'] = Project::where('budget_health', 'overrun') |
|
|
|
|
|
|
|
->count(); |
|
|
|
|
|
|
|
} elseif ($all_project == 'true') { |
|
|
|
$response['data']['overrun'] = Project::whereIn('divisi_id', $divisi) |
|
|
|
$response['data']['overrun'] = Project::whereIn('divisi_id', $divisi) |
|
|
|
->where([['budget_health', 'overrun']]) |
|
|
|
->where([['budget_health', 'overrun']]) |
|
|
|
->count(); |
|
|
|
->count(); |
|
|
@ -298,7 +301,10 @@ class DashboardBoDController extends Controller |
|
|
|
->count(); |
|
|
|
->count(); |
|
|
|
} |
|
|
|
} |
|
|
|
// arr warning |
|
|
|
// arr warning |
|
|
|
if ($all_project) { |
|
|
|
if ($role === 'Super Admin') { |
|
|
|
|
|
|
|
$response['data']['warning'] = Project::where('budget_health', 'warning') |
|
|
|
|
|
|
|
->count(); |
|
|
|
|
|
|
|
} elseif ($all_project == 'true') { |
|
|
|
$response['data']['warning'] = Project::whereIn('divisi_id', $divisi) |
|
|
|
$response['data']['warning'] = Project::whereIn('divisi_id', $divisi) |
|
|
|
->where([['budget_health', 'warning']]) |
|
|
|
->where([['budget_health', 'warning']]) |
|
|
|
->count(); |
|
|
|
->count(); |
|
|
@ -308,7 +314,10 @@ class DashboardBoDController extends Controller |
|
|
|
->count(); |
|
|
|
->count(); |
|
|
|
} |
|
|
|
} |
|
|
|
// arr on-budget |
|
|
|
// arr on-budget |
|
|
|
if ($all_project) { |
|
|
|
if ($role === 'Super Admin') { |
|
|
|
|
|
|
|
$response['data']['on-budget'] = Project::where('budget_health', 'on-budget') |
|
|
|
|
|
|
|
->count(); |
|
|
|
|
|
|
|
} elseif ($all_project == 'true') { |
|
|
|
$response['data']['on-budget'] = Project::whereIn('divisi_id', $divisi) |
|
|
|
$response['data']['on-budget'] = Project::whereIn('divisi_id', $divisi) |
|
|
|
->where([['budget_health', 'on-budget']]) |
|
|
|
->where([['budget_health', 'on-budget']]) |
|
|
|
->count(); |
|
|
|
->count(); |
|
|
|