Commit 95b8bea6 authored by Guilherme Silva's avatar Guilherme Silva
Browse files

Ajuste na exibição de trabalhos para os avaliadores

parent 6a79f4fa
...@@ -76,10 +76,14 @@ class AvaliadorController extends Controller ...@@ -76,10 +76,14 @@ class AvaliadorController extends Controller
$trabalhosIn = []; $trabalhosIn = [];
$aval = $user->avaliadors->where('user_id',$user->id)->first(); $aval = $user->avaliadors->where('user_id',$user->id)->first();
foreach ($aval->trabalhos->where('evento_id',$evento->id) as $trab){ 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 ){ 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")){
array_push($trabalhosIn,$aval->trabalhos()->where("trabalho_id",$trab->id)->first()); 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){ 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")){
array_push($trabalhosEx,$aval->trabalhos()->where("trabalho_id",$trab->id)->first()); array_push($trabalhosEx,$aval->trabalhos()->where("trabalho_id",$trab->id)->first());
} }
} }
......
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