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.
30 lines
654 B
30 lines
654 B
2 years ago
|
<?php
|
||
|
|
||
|
namespace App\Console\Commands;
|
||
|
|
||
|
use Illuminate\Console\Command;
|
||
|
use App\Helpers\MasterFunctionsHelper;
|
||
|
use App\Models\Project;
|
||
|
|
||
|
class CalculateSCurve extends Command
|
||
|
{
|
||
|
protected $signature = 'calculate:scurve {project_id}';
|
||
|
|
||
|
protected $description = 'Calculate S Curve';
|
||
|
|
||
|
public function handle()
|
||
|
{
|
||
|
$project_id = $this->argument('project_id');
|
||
|
$project = Project::find($project_id);
|
||
|
|
||
|
$project->calculation_status = true;
|
||
|
$project->save();
|
||
|
|
||
|
$data = MasterFunctionsHelper::CalculateSCurve($project_id);
|
||
|
|
||
|
$project->scurve = json_encode($data);
|
||
|
$project->calculation_status = true;
|
||
|
$project->save();
|
||
|
}
|
||
|
}
|