Custom Backend OSPRO Surveyor Indonesia
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Console\Commands;
|
|
|
|
|
|
|
|
use App\Models\HierarchyFtth;
|
|
|
|
use Illuminate\Console\Command;
|
|
|
|
use App\Helpers\MasterFunctionsHelper;
|
|
|
|
use App\Models\Project;
|
|
|
|
|
|
|
|
class CalculateProgressGantt extends Command
|
|
|
|
{
|
|
|
|
protected $signature = 'calculate:progressgantt {hierarchy_id}';
|
|
|
|
|
|
|
|
protected $description = 'Calculate Progress Gantt';
|
|
|
|
|
|
|
|
public function handle()
|
|
|
|
{
|
|
|
|
$hierarchy_id = $this->argument('hierarchy_id');
|
|
|
|
$hierarchy = HierarchyFtth::findOrFail($hierarchy_id);
|
|
|
|
$project = Project::find($hierarchy->project_id);
|
|
|
|
|
|
|
|
$project->calculation_status = true;
|
|
|
|
$project->save();
|
|
|
|
|
|
|
|
$data = MasterFunctionsHelper::CalculateSCurve(null, $hierarchy_id);
|
|
|
|
|
|
|
|
$project->scurve = json_encode($data);
|
|
|
|
$project->calculation_status = true;
|
|
|
|
$project->save();
|
|
|
|
}
|
|
|
|
}
|