Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Walter Felipe
submeta
Commits
6d5f55cf
Commit
6d5f55cf
authored
Aug 10, 2022
by
GuilhermeGz
Browse files
Alterada a forma de listagem das avalições a serem feitas pelo avaliador no perfil avaliador
parent
6627259a
Changes
1
Hide whitespace changes
Inline
Side-by-side
app/Http/Controllers/AvaliadorController.php
View file @
6d5f55cf
...
...
@@ -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
]);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment