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

1
app/Http/Controllers/ProjectController.php

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

Loading…
Cancel
Save