Commit 6d5f55cf authored by GuilhermeGz's avatar GuilhermeGz
Browse files

Alterada a forma de listagem das avalições a serem feitas pelo avaliador no perfil avaliador

parent 6627259a
......@@ -84,21 +84,20 @@ class AvaliadorController extends Controller
$trabalhosIn = [];
$aval = $user->avaliadors->where('user_id',$user->id)->first();
foreach ($aval->trabalhos->where('evento_id',$evento->id) as $trab){
if($aval->trabalhos()->where("trabalho_id",$trab->id)->first()->pivot->acesso == 2
|| $aval->trabalhos()->where("trabalho_id",$trab->id)->first()->pivot->acesso == 3 ||
($aval->trabalhos()->where("trabalho_id",$trab->id)->first()->pivot->acesso == null && $aval->tipo == "Interno")){
if($aval->trabalhos()->where("trabalho_id",$trab->id)->first()->pivot->orderBy('created_at','DESC')->first()->acesso == 2
|| $aval->trabalhos()->where("trabalho_id",$trab->id)->first()->pivot->orderBy('created_at','DESC')->first()->acesso == 3 ||
($aval->trabalhos()->where("trabalho_id",$trab->id)->first()->pivot->orderBy('created_at','DESC')->first()->acesso == null && $aval->tipo == "Interno")){
array_push($trabalhosIn,$aval->trabalhos()->where("trabalho_id",$trab->id)->first());
}
if ($aval->trabalhos()->where("trabalho_id",$trab->id)->first()->pivot->acesso == 1 ||
$aval->trabalhos()->where("trabalho_id",$trab->id)->first()->pivot->acesso == 3 ||
($aval->trabalhos()->where("trabalho_id",$trab->id)->first()->pivot->acesso == null && $aval->tipo == "Externo")){
if ($aval->trabalhos()->where("trabalho_id",$trab->id)->first()->pivot->orderBy('created_at','DESC')->first()->acesso == 1 ||
$aval->trabalhos()->where("trabalho_id",$trab->id)->first()->pivot->orderBy('created_at','DESC')->first()->acesso == 3 ||
($aval->trabalhos()->where("trabalho_id",$trab->id)->first()->pivot->orderBy('created_at','DESC')->first()->acesso == null && $aval->tipo == "Externo")){
array_push($trabalhosEx,$aval->trabalhos()->where("trabalho_id",$trab->id)->first());
}
}
//dd();
return view('avaliador.listarTrabalhos', ['trabalhosEx'=>$trabalhosEx,'trabalhosIn'=>$trabalhosIn, 'evento'=>$evento]);
return view('avaliador.listarTrabalhos', ['trabalhosEx'=>$trabalhosEx,'trabalhosIn'=>$trabalhosIn, 'evento'=>$evento]);
}
......
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