Browse Source

fix dashboard

pull/3/head
Wahyu Ramadhan 1 year ago
parent
commit
391507dedb
  1. 7
      app/Http/Controllers/DashboardBoDController.php

7
app/Http/Controllers/DashboardBoDController.php

@ -10,6 +10,7 @@ use App\Models\User;
use App\Models\UserToVersionGantt;
use Illuminate\Support\Collection;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Log;
class DashboardBoDController extends Controller
{
@ -130,8 +131,10 @@ class DashboardBoDController extends Controller
$project->scurve = MasterFunctionsHelper::getSCurve($project->id);
$selisihProgress = 0;
if($project->scurve && $project->scurve[0]){
$planningProgress = $project->scurve[0]['data']['percentagePlan'][count($project->scurve[0]['data']['percentagePlan'])-1];
$actualProgress = $project->scurve[0]['data']['percentageReal'][count($project->scurve[0]['data']['percentageReal'])-1];
$planningArray = $project->scurve[0]['data']['percentagePlan'];
$actualArray = $project->scurve[0]['data']['percentageReal'];
$planningProgress = !empty($planningArray) ? $planningArray[count($planningArray) - 1] : 0;
$actualProgress = !empty($actualArray) ? $actualArray[count($actualArray) - 1] : 0;
}
$selisihProgress = $planningProgress - $actualProgress;
try {

Loading…
Cancel
Save