From caac6506f89eb6207d4f78d40d37f05ede646b00 Mon Sep 17 00:00:00 2001 From: farhantock Date: Thu, 11 Jan 2024 22:47:30 +0700 Subject: [PATCH] add sponsor --- app/Http/Controllers/ProjectController.php | 20 +++++++++++--------- app/Models/Project.php | 3 ++- routes/web.php | 20 ++++++++++---------- 3 files changed, 23 insertions(+), 20 deletions(-) diff --git a/app/Http/Controllers/ProjectController.php b/app/Http/Controllers/ProjectController.php index 719908c..7d89879 100644 --- a/app/Http/Controllers/ProjectController.php +++ b/app/Http/Controllers/ProjectController.php @@ -123,7 +123,8 @@ class ProjectController extends Controller 'phase_id', 'calculation_status', 'md.name as divisi_name', - 'nickname' + 'nickname', + 'sponsor' ) ->join('m_divisi as md', 'md.id', '=', 'm_proyek.divisi_id') ->where('m_proyek.id', $id) @@ -322,7 +323,8 @@ class ProjectController extends Controller 'created_at', 'created_by', 'updated_at', - 'updated_by' + 'updated_by', + 'sponsor' )->orderBy('id', 'desc') // ->where("created_by",$this->currentName) ->get(); @@ -620,19 +622,19 @@ class ProjectController extends Controller // } - $plannedStart = Activity::where('version_gantt_id', $ganttId) - ->orderBy('planned_start') - ->value('planned_start'); - $plannedEnd = Activity::where('version_gantt_id', $ganttId) - ->orderByDesc('planned_end') - ->value('planned_end'); + $plannedStart = Activity::where('version_gantt_id', $ganttId) + ->orderBy('planned_start') + ->value('planned_start'); + $plannedEnd = Activity::where('version_gantt_id', $ganttId) + ->orderByDesc('planned_end') + ->value('planned_end'); if (isset($result->header)) { $result->header->start_date = $startDate; $result->header->end_date = $maxEndDate->end_date; $result->header->planned_start = $plannedStart; $result->header->planned_end = $plannedEnd; } - return response()->json(['status'=>'success','code'=> 200,'data'=>$result, 'gantt'=>$ganttId], 200); + return response()->json(['status' => 'success', 'code' => 200, 'data' => $result, 'gantt' => $ganttId], 200); } public function getOverdueActivities(Request $request) diff --git a/app/Models/Project.php b/app/Models/Project.php index 2ac0fd5..55e5f55 100644 --- a/app/Models/Project.php +++ b/app/Models/Project.php @@ -51,6 +51,7 @@ class Project extends Model 'created_by', 'updated_at', 'updated_by', - 'created_by_id' + 'created_by_id', + 'sponsor' ]; } diff --git a/routes/web.php b/routes/web.php index 5b8aff6..cb953bd 100644 --- a/routes/web.php +++ b/routes/web.php @@ -23,16 +23,16 @@ $router->group(['prefix' => 'api', 'middleware' => 'cors'], function () use ($ro $router->group(['middleware' => ['auth', 'cors']], function () use ($router) { - $router->get('/dashboard/get-company-cashflow[/{year}]', 'DashboardBoDController@getCompanyCashFlow'); // project expenditure - $router->get('/dashboard/get-invoice-outstanding[/{year}]', 'DashboardBoDController@getInvoiceOutstanding'); // project invoice vs cash in - $router->get('/dashboard/get-total-project-per-schedule-health[/{year}]', 'DashboardBoDController@getTotalProjectPerScheduleHealth'); - $router->get('/dashboard/get-total-project-per-budget-health[/{year}]', 'DashboardBoDController@getTotalProjectPerBudgetHealth'); - $router->get('/dashboard/get-total-project-schedule-health-per-division[/{year}]', 'DashboardBoDController@getTotalProjectScheduleHealthPerDivision'); - $router->get('/dashboard/get-total-project-budget-health-per-division[/{year}]', 'DashboardBoDController@getTotalProjectBudgetHealthPerDivision'); - $router->get('/dashboard/get-total-project-per-phase[/{year}]', 'DashboardBoDController@getTotalProjectPerPhase'); - $router->get('/dashboard/get-total-project-per-division[/{year}]', 'DashboardBoDController@getTotalProjectPerDivision'); - $router->get('/dashboard/get-total-project-value-per-division[/{year}]', 'DashboardBoDController@getTotalProjectValuePerDivision'); - $router->get('/dashboard/get-detail-expenditure[/{year}]', 'DashboardBoDController@getDetailExpenditure'); + $router->get('/dashboard/get-company-cashflow', 'DashboardBoDController@getCompanyCashFlow'); // project expenditure + $router->get('/dashboard/get-invoice-outstanding', 'DashboardBoDController@getInvoiceOutstanding'); // project invoice vs cash in + $router->get('/dashboard/get-total-project-per-schedule-health', 'DashboardBoDController@getTotalProjectPerScheduleHealth'); + $router->get('/dashboard/get-total-project-per-budget-health', 'DashboardBoDController@getTotalProjectPerBudgetHealth'); + $router->get('/dashboard/get-total-project-schedule-health-per-division', 'DashboardBoDController@getTotalProjectScheduleHealthPerDivision'); + $router->get('/dashboard/get-total-project-budget-health-per-division', 'DashboardBoDController@getTotalProjectBudgetHealthPerDivision'); + $router->get('/dashboard/get-total-project-per-phase', 'DashboardBoDController@getTotalProjectPerPhase'); + $router->get('/dashboard/get-total-project-per-division', 'DashboardBoDController@getTotalProjectPerDivision'); + $router->get('/dashboard/get-total-project-value-per-division', 'DashboardBoDController@getTotalProjectValuePerDivision'); + $router->get('/dashboard/get-detail-expenditure', 'DashboardBoDController@getDetailExpenditure'); $router->post('/role/search', 'RoleController@search'); $router->post('/role/add', 'RoleController@add');