of(ReagendamentoCancelamentoExameService::datatable($request)) ->filterColumn('cadastro_cidadao.data_nascimento', function ($query, $keyword) { $query ->whereRaw("DATE_FORMAT(cadastro_cidadao.data_nascimento, '%d/%m/%Y') like ?", ["%{$keyword}%"]) ->orWhereRaw( "CONCAT( SUBSTR(cadastro_cidadao.data_nascimento,9,2), SUBSTR(cadastro_cidadao.data_nascimento,6,2), SUBSTR(cadastro_cidadao.data_nascimento,1,4) ) like ?", ["%{$keyword}%"] ); }) ->filterColumn('cadastro_cidadao.cpf', function ($query, $keyword) { $query ->whereRaw("cadastro_cidadao.cpf like ?", ["%{$keyword}%"]) ->orWhereRaw( "CONCAT( SUBSTR(cadastro_cidadao.cpf,1,3), '.', SUBSTR(cadastro_cidadao.cpf,4,3), '.', SUBSTR(cadastro_cidadao.cpf,7,3), '-', SUBSTR(cadastro_cidadao.cpf,10,2) ) like ?", ["%{$keyword}%"] ); }) ->skipTotalRecords() ->toJson(); } public function edit($usuarioId) { $this->auth(__FUNCTION__); return response()->json(ReagendamentoCancelamentoExameService::edit($usuarioId), Response::HTTP_OK); } public function getJornadas(Request $request) { return response()->json(ReagendamentoCancelamentoExameService::getJornadas($request), Response::HTTP_OK); } public function getPrestadores(Request $request) { return response()->json(ReagendamentoCancelamentoExameService::getPrestadores($request), Response::HTTP_OK); } public function getGrupos(Request $request) { return response()->json(ReagendamentoCancelamentoExameService::getGrupos($request), Response::HTTP_OK); } public function getJornadasDestino(Request $request) { return response()->json(ReagendamentoCancelamentoExameService::getJornadasDestino($request), Response::HTTP_OK); } public function reschedule() { $this->auth(__FUNCTION__); return response()->json(ReagendamentoCancelamentoExameService::reschedule(), Response::HTTP_OK); } public function cancel() { $this->auth(__FUNCTION__); return response()->json(ReagendamentoCancelamentoExameService::cancel(), Response::HTTP_OK); } }