Browse Source

Project Expenditure order by DESC, Search Divisi

pull/3/head
farhan048 2 years ago
parent
commit
b630b97063
  1. 1
      app/Http/Controllers/DashboardBoDController.php
  2. 9
      app/Http/Controllers/DivisiController.php

1
app/Http/Controllers/DashboardBoDController.php

@ -304,6 +304,7 @@ class DashboardBoDController extends Controller
$year = $this->interpolateYear($year);
$projects = Project::where('mulai_proyek', 'like', $year)
/* ->orWhere('akhir_proyek', 'like', $year) */
->orderBy('id', 'desc')
->get();
foreach($projects as $project){
$lastGantt = MasterFunctionsHelper::getLatestGantt($project->id);

9
app/Http/Controllers/DivisiController.php

@ -72,8 +72,13 @@ class DivisiController extends Controller
public function search()
{
return $this->list();
// cant use builder for this case
$payload = $request->all();
$dataBuilder = $this->setUpPayload($payload, 'm_divisi');
$builder = $dataBuilder['builder'];
$countBuilder = $dataBuilder['count'];
$dataGet = $builder->get();
$totalRecord = $countBuilder->count();
return response()->json(['status'=>'success','code'=>200,'data'=>$dataGet, 'totalRecord'=>$totalRecord], 200);
}
public function list()

Loading…
Cancel
Save