Browse Source

add sponsor

pull/1/head
farhantock 12 months ago
parent
commit
caac6506f8
  1. 20
      app/Http/Controllers/ProjectController.php
  2. 3
      app/Models/Project.php
  3. 20
      routes/web.php

20
app/Http/Controllers/ProjectController.php

@ -123,7 +123,8 @@ class ProjectController extends Controller
'phase_id', 'phase_id',
'calculation_status', 'calculation_status',
'md.name as divisi_name', 'md.name as divisi_name',
'nickname' 'nickname',
'sponsor'
) )
->join('m_divisi as md', 'md.id', '=', 'm_proyek.divisi_id') ->join('m_divisi as md', 'md.id', '=', 'm_proyek.divisi_id')
->where('m_proyek.id', $id) ->where('m_proyek.id', $id)
@ -322,7 +323,8 @@ class ProjectController extends Controller
'created_at', 'created_at',
'created_by', 'created_by',
'updated_at', 'updated_at',
'updated_by' 'updated_by',
'sponsor'
)->orderBy('id', 'desc') )->orderBy('id', 'desc')
// ->where("created_by",$this->currentName) // ->where("created_by",$this->currentName)
->get(); ->get();
@ -620,19 +622,19 @@ class ProjectController extends Controller
// } // }
$plannedStart = Activity::where('version_gantt_id', $ganttId) $plannedStart = Activity::where('version_gantt_id', $ganttId)
->orderBy('planned_start') ->orderBy('planned_start')
->value('planned_start'); ->value('planned_start');
$plannedEnd = Activity::where('version_gantt_id', $ganttId) $plannedEnd = Activity::where('version_gantt_id', $ganttId)
->orderByDesc('planned_end') ->orderByDesc('planned_end')
->value('planned_end'); ->value('planned_end');
if (isset($result->header)) { if (isset($result->header)) {
$result->header->start_date = $startDate; $result->header->start_date = $startDate;
$result->header->end_date = $maxEndDate->end_date; $result->header->end_date = $maxEndDate->end_date;
$result->header->planned_start = $plannedStart; $result->header->planned_start = $plannedStart;
$result->header->planned_end = $plannedEnd; $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) public function getOverdueActivities(Request $request)

3
app/Models/Project.php

@ -51,6 +51,7 @@ class Project extends Model
'created_by', 'created_by',
'updated_at', 'updated_at',
'updated_by', 'updated_by',
'created_by_id' 'created_by_id',
'sponsor'
]; ];
} }

20
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->group(['middleware' => ['auth', 'cors']], function () use ($router) {
$router->get('/dashboard/get-company-cashflow[/{year}]', 'DashboardBoDController@getCompanyCashFlow'); // project expenditure $router->get('/dashboard/get-company-cashflow', 'DashboardBoDController@getCompanyCashFlow'); // project expenditure
$router->get('/dashboard/get-invoice-outstanding[/{year}]', 'DashboardBoDController@getInvoiceOutstanding'); // project invoice vs cash in $router->get('/dashboard/get-invoice-outstanding', '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-schedule-health', 'DashboardBoDController@getTotalProjectPerScheduleHealth');
$router->get('/dashboard/get-total-project-per-budget-health[/{year}]', 'DashboardBoDController@getTotalProjectPerBudgetHealth'); $router->get('/dashboard/get-total-project-per-budget-health', 'DashboardBoDController@getTotalProjectPerBudgetHealth');
$router->get('/dashboard/get-total-project-schedule-health-per-division[/{year}]', 'DashboardBoDController@getTotalProjectScheduleHealthPerDivision'); $router->get('/dashboard/get-total-project-schedule-health-per-division', 'DashboardBoDController@getTotalProjectScheduleHealthPerDivision');
$router->get('/dashboard/get-total-project-budget-health-per-division[/{year}]', 'DashboardBoDController@getTotalProjectBudgetHealthPerDivision'); $router->get('/dashboard/get-total-project-budget-health-per-division', 'DashboardBoDController@getTotalProjectBudgetHealthPerDivision');
$router->get('/dashboard/get-total-project-per-phase[/{year}]', 'DashboardBoDController@getTotalProjectPerPhase'); $router->get('/dashboard/get-total-project-per-phase', 'DashboardBoDController@getTotalProjectPerPhase');
$router->get('/dashboard/get-total-project-per-division[/{year}]', 'DashboardBoDController@getTotalProjectPerDivision'); $router->get('/dashboard/get-total-project-per-division', 'DashboardBoDController@getTotalProjectPerDivision');
$router->get('/dashboard/get-total-project-value-per-division[/{year}]', 'DashboardBoDController@getTotalProjectValuePerDivision'); $router->get('/dashboard/get-total-project-value-per-division', 'DashboardBoDController@getTotalProjectValuePerDivision');
$router->get('/dashboard/get-detail-expenditure[/{year}]', 'DashboardBoDController@getDetailExpenditure'); $router->get('/dashboard/get-detail-expenditure', 'DashboardBoDController@getDetailExpenditure');
$router->post('/role/search', 'RoleController@search'); $router->post('/role/search', 'RoleController@search');
$router->post('/role/add', 'RoleController@add'); $router->post('/role/add', 'RoleController@add');

Loading…
Cancel
Save