Commit 906a6afc authored by Guilherme Silva's avatar Guilherme Silva
Browse files

Correção na listagem de pareceres para os avaliadores

parent bb684a4e
...@@ -75,7 +75,7 @@ class AvaliadorController extends Controller ...@@ -75,7 +75,7 @@ class AvaliadorController extends Controller
$trabalhosEx = []; $trabalhosEx = [];
$trabalhosIn = []; $trabalhosIn = [];
$aval = $user->avaliadors->where('user_id',$user->id)->first(); $aval = $user->avaliadors->where('user_id',$user->id)->first();
foreach ($aval->trabalhos 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 ){
array_push($trabalhosIn,$aval->trabalhos()->where("trabalho_id",$trab->id)->first()); array_push($trabalhosIn,$aval->trabalhos()->where("trabalho_id",$trab->id)->first());
} }
...@@ -136,7 +136,7 @@ class AvaliadorController extends Controller ...@@ -136,7 +136,7 @@ class AvaliadorController extends Controller
$trabalhosEx = []; $trabalhosEx = [];
$trabalhosIn = []; $trabalhosIn = [];
$aval = $user->avaliadors->where('user_id',$user->id)->first(); $aval = $user->avaliadors->where('user_id',$user->id)->first();
foreach ($aval->trabalhos 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 ){
array_push($trabalhosIn,$aval->trabalhos()->where("trabalho_id",$trab->id)->first()); array_push($trabalhosIn,$aval->trabalhos()->where("trabalho_id",$trab->id)->first());
} }
...@@ -214,7 +214,7 @@ class AvaliadorController extends Controller ...@@ -214,7 +214,7 @@ class AvaliadorController extends Controller
$trabalhosEx = []; $trabalhosEx = [];
$trabalhosIn = []; $trabalhosIn = [];
$aval = $user->avaliadors->where('user_id',$user->id)->first(); $aval = $user->avaliadors->where('user_id',$user->id)->first();
foreach ($aval->trabalhos 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 ){
array_push($trabalhosIn,$aval->trabalhos()->where("trabalho_id",$trab->id)->first()); array_push($trabalhosIn,$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