|
|
@ -2,6 +2,7 @@ |
|
|
|
|
|
|
|
|
|
|
|
namespace App\Http\Controllers; |
|
|
|
namespace App\Http\Controllers; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
use Illuminate\Http\Request; |
|
|
|
use App\Models\{ |
|
|
|
use App\Models\{ |
|
|
|
User, |
|
|
|
User, |
|
|
|
Project, |
|
|
|
Project, |
|
|
@ -9,13 +10,26 @@ use App\Models\{ |
|
|
|
ProjectIssues, |
|
|
|
ProjectIssues, |
|
|
|
ProjectRisks |
|
|
|
ProjectRisks |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
class ProjectCarausellController extends Controller |
|
|
|
class ProjectCarausellController extends Controller |
|
|
|
{ |
|
|
|
{ |
|
|
|
public function invoke() { |
|
|
|
public function invoke(Request $request) |
|
|
|
|
|
|
|
{ |
|
|
|
// Master Data |
|
|
|
// Master Data |
|
|
|
$projectData = Project::query() |
|
|
|
$company_id = $request->route('company_id'); |
|
|
|
->select("id","nama","kode_sortname","pm_id","budget_health","calculation_status","mulai_proyek","akhir_proyek","rencana_biaya","company","scurve") |
|
|
|
$all_project = $request->route('all_project'); |
|
|
|
->get(); |
|
|
|
$hierarchy = $request->route('hierarchy'); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$query = Project::query() |
|
|
|
|
|
|
|
->select("id", "nama", "kode_sortname", "pm_id", "budget_health", "calculation_status", "mulai_proyek", "akhir_proyek", "rencana_biaya", "company", "scurve"); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if ($all_project) { |
|
|
|
|
|
|
|
$query->where('company_id', $company_id); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
$query->where('created_by_id', $hierarchy); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$projectData = $query->get(); |
|
|
|
|
|
|
|
|
|
|
|
$arr = []; |
|
|
|
$arr = []; |
|
|
|
foreach ($projectData as $project) { |
|
|
|
foreach ($projectData as $project) { |
|
|
|