Commit f06d9de5 authored by Gabriel-31415's avatar Gabriel-31415
Browse files

ajuste

parent 2593515b
...@@ -15,7 +15,7 @@ class CoordenadorComissao extends Model ...@@ -15,7 +15,7 @@ class CoordenadorComissao extends Model
} }
public function trabalho(){ public function trabalho(){
return $this->hasMany('App\Trabalho'); return $this->hasMany('App\Trabalho', 'coordenador_id');
} }
} }
...@@ -317,7 +317,12 @@ class TrabalhoController extends Controller ...@@ -317,7 +317,12 @@ class TrabalhoController extends Controller
{ {
$projeto = Auth::user()->proponentes->trabalhos()->where('id', $id)->first(); $projeto = Auth::user()->proponentes->trabalhos()->where('id', $id)->first();
if(Auth::user()->tipo == 'administrador'){
$projeto = Trabalho::find($id);
}
if(!$projeto){ if(!$projeto){
// $projeto = Auth::user()->coordenadorComissao->trabalho()->where('id', $id)->first();
return back()->withErrors(['Proposta não encontrada!']); return back()->withErrors(['Proposta não encontrada!']);
} }
$edital = Evento::find($projeto->evento_id); $edital = Evento::find($projeto->evento_id);
......
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