diff --git a/app/Http/Controllers/ProjectController.php b/app/Http/Controllers/ProjectController.php index 9d50370..5149d0d 100644 --- a/app/Http/Controllers/ProjectController.php +++ b/app/Http/Controllers/ProjectController.php @@ -214,24 +214,11 @@ class ProjectController extends Controller $totalRecord = $countBuilder->count(); return response()->json(['status'=>'success','code'=>200,'data'=>$dataGet, 'totalRecord'=>$totalRecord], 200); - } - - public function searchCustom(Request $request) - { - $payload = $request->all(); - - $dataBuilder = $this->setUpPayloadSelect($payload, 'm_proyek'); - $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() { - $data = Project::orderBy('id', 'desc')->get(); + $data = Project::select("id", "nama", "kode_sortname")->orderBy('id', 'desc')->get(); $countData = $data->count(); if(!$data) @@ -254,7 +241,7 @@ class ProjectController extends Controller } try { $projectsByType = DB::table('m_proyek') - ->select('m_type_proyek.name', DB::raw('count(*) as total')) + ->select('m_type_proyek.name', DB::raw('count(id) as total')) ->join('m_type_proyek', 'm_type_proyek.id', '=', 'm_proyek.type_proyek_id') ->groupBy('m_type_proyek.name') ->get();