Commit 1cdf15f3 authored by Guilherme Silva's avatar Guilherme Silva
Browse files

Ajuste na paginação

parent 98aaf102
...@@ -72,17 +72,11 @@ class AdministradorController extends Controller ...@@ -72,17 +72,11 @@ class AdministradorController extends Controller
public function analisar(Request $request){ public function analisar(Request $request){
$evento = Evento::find($request->evento_id); $evento = Evento::find($request->evento_id);
$status = ['submetido', 'avaliado', 'aprovado', 'reprovado', 'corrigido']; $status = ['submetido', 'avaliado', 'aprovado', 'reprovado', 'corrigido'];
//$withPath = '/usuarios/analisarProjetos?evento_id='.$evento->id;
$withPath = "http://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";
if($request->column != null ) {
$status = [$request->column];
$withPath = '/usuarios/analisarProjetos/'.$request->column.'?evento_id='.$evento->id;
}
$trabalhos = Trabalho::where('evento_id', $evento->id) $trabalhos = Trabalho::where('evento_id', $evento->id)
->whereIn('status', $status) ->whereIn('status', $status)
->orderBy('titulo') ->orderBy('titulo')
->paginate(10) ->paginate(10);
->withPath($withPath);
$funcaoParticipantes = FuncaoParticipantes::all(); $funcaoParticipantes = FuncaoParticipantes::all();
// $participantes = Participante::where('trabalho_id', $id)->get(); // $participantes = Participante::where('trabalho_id', $id)->get();
...@@ -93,13 +87,7 @@ class AdministradorController extends Controller ...@@ -93,13 +87,7 @@ class AdministradorController extends Controller
} }
// Utilizado para paginação de Collection // Utilizado para paginação de Collection
public function paginate($items, $perPage = 5, $page = null, $options = [])
{
$page = $page ?: (Paginator::currentPage() ?: 1);
$items = $items instanceof Collection ? $items : Collection::make($items);
return new LengthAwarePaginator($items->forPage($page, $perPage), $items->count(), $perPage, $page, $options);
}
public function analisarProposta(Request $request){ public function analisarProposta(Request $request){
......
...@@ -114,7 +114,7 @@ ...@@ -114,7 +114,7 @@
<div class="row justify-content-center" > <div class="row justify-content-center" >
<div class="col-md-11"> <div class="col-md-11">
<br> <br>
{{ $trabalhos->links() }} {{ $trabalhos->appends(['evento_id' => $evento->id])->links() }}
</div> </div>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment