|
|
@ -216,22 +216,9 @@ class ProjectController extends Controller |
|
|
|
return response()->json(['status'=>'success','code'=>200,'data'=>$dataGet, 'totalRecord'=>$totalRecord], 200); |
|
|
|
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() |
|
|
|
public function list() |
|
|
|
{ |
|
|
|
{ |
|
|
|
$data = Project::orderBy('id', 'desc')->get(); |
|
|
|
$data = Project::select("id", "nama", "kode_sortname")->orderBy('id', 'desc')->get(); |
|
|
|
$countData = $data->count(); |
|
|
|
$countData = $data->count(); |
|
|
|
|
|
|
|
|
|
|
|
if(!$data) |
|
|
|
if(!$data) |
|
|
@ -254,7 +241,7 @@ class ProjectController extends Controller |
|
|
|
} |
|
|
|
} |
|
|
|
try { |
|
|
|
try { |
|
|
|
$projectsByType = DB::table('m_proyek') |
|
|
|
$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') |
|
|
|
->join('m_type_proyek', 'm_type_proyek.id', '=', 'm_proyek.type_proyek_id') |
|
|
|
->groupBy('m_type_proyek.name') |
|
|
|
->groupBy('m_type_proyek.name') |
|
|
|
->get(); |
|
|
|
->get(); |
|
|
|