Browse Source

feat: update be

pull/5/head
wahyun 5 months ago
parent
commit
126690bdbd
  1. 12
      app/Http/Controllers/DashboardBoDController.php
  2. 1
      app/Http/Controllers/ProjectController.php

12
app/Http/Controllers/DashboardBoDController.php

@ -41,7 +41,6 @@ class DashboardBoDController extends Controller
->sum(DB::raw('CAST("rencana_biaya" AS DOUBLE PRECISION)'));
}
$totalBudgets = Project::sum(DB::raw('CAST("rencana_biaya" AS DOUBLE PRECISION)'));
dd($totalBudgets);
$projects = null;
if (!empty($all_project) || $role === "Super Admin") {
@ -380,7 +379,6 @@ class DashboardBoDController extends Controller
public function getTotalProjectPerPhase($role_name, $all_project, $hierarchy)
{
$role = urldecode($role_name);
$projectPhases = null;
$projectPhases = ProjectPhase::orderBy('order')->get();
foreach ($projectPhases as $phase) {
@ -460,17 +458,15 @@ class DashboardBoDController extends Controller
}
public function getDetailExpenditure($year = '%', $all_project, $hierarchy)
public function getDetailExpenditure($all_project, $hierarchy, $role_name)
{
$year = $this->interpolateYear($year);
// $year = $this->interpolateYear($year);
$projects = null;
if ($all_project) {
$projects = Project::where('mulai_proyek', 'like', $year)
->orderBy('id', 'desc')
$projects = Project::orderBy('id', 'desc')
->get();
} else {
$projects = Project::where('mulai_proyek', 'like', $year)
->where('created_by_id', $hierarchy)
$projects = Project::where('created_by_id', $hierarchy)
->orderBy('id', 'desc')
->get();
}

1
app/Http/Controllers/ProjectController.php

@ -186,7 +186,6 @@ class ProjectController extends Controller
{
DB::beginTransaction();
$data = Project::find($id);
$dateNow = Carbon::now();
if ($data) {
$this->deleteRelative($id);
if ($data->delete()) {

Loading…
Cancel
Save