|
|
@ -42,13 +42,13 @@ class ScheduleHealth extends Command |
|
|
|
|
|
|
|
|
|
|
|
public function handle() |
|
|
|
public function handle() |
|
|
|
{ |
|
|
|
{ |
|
|
|
echo "\n------------------------------------------\n"; |
|
|
|
// echo "\n------------------------------------------\n"; |
|
|
|
echo "Command Start. \n"; |
|
|
|
// echo "Command Start. \n"; |
|
|
|
Log::info("Command Start."); |
|
|
|
// Log::info("Command Start."); |
|
|
|
$projects = Project::get(); |
|
|
|
$projects = Project::get(); |
|
|
|
$totalProjects = $projects->count(); |
|
|
|
$totalProjects = $projects->count(); |
|
|
|
$updatedProjects = []; |
|
|
|
$updatedProjects = []; |
|
|
|
Log::info($totalProjects); |
|
|
|
// Log::info($totalProjects); |
|
|
|
foreach ($projects as $index => $project) { |
|
|
|
foreach ($projects as $index => $project) { |
|
|
|
$project->scurve = MasterFunctionsHelper::getSCurve($project->id); |
|
|
|
$project->scurve = MasterFunctionsHelper::getSCurve($project->id); |
|
|
|
|
|
|
|
|
|
|
@ -62,7 +62,7 @@ class ScheduleHealth extends Command |
|
|
|
|
|
|
|
|
|
|
|
$scheduleHealth = ($selisihProgress > 0 && $selisihProgress <= 20) ? 'warning' : (($selisihProgress == 0) ? 'on-schedule' : 'behind-schedule'); |
|
|
|
$scheduleHealth = ($selisihProgress > 0 && $selisihProgress <= 20) ? 'warning' : (($selisihProgress == 0) ? 'on-schedule' : 'behind-schedule'); |
|
|
|
|
|
|
|
|
|
|
|
Log::info("Updating project with ID: " . $project->id . " - Schedule Health: " . $scheduleHealth); |
|
|
|
// Log::info("Updating project with ID: " . $project->id . " - Schedule Health: " . $scheduleHealth); |
|
|
|
$project->update(['schedule_health' => $scheduleHealth]); |
|
|
|
$project->update(['schedule_health' => $scheduleHealth]); |
|
|
|
$updatedProjects[] = $project->id; |
|
|
|
$updatedProjects[] = $project->id; |
|
|
|
} |
|
|
|
} |
|
|
|