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
pad-upe
Commits
faf98b0c
"app/git@sites.upe.br:walter.felipe/submeta.git" did not exist on "517aca3024bbc446013754989613b712f1ab360c"
Commit
faf98b0c
authored
Aug 08, 2023
by
PedroLopesUPE
Browse files
Bug fix: correções de error do userpad e padcontroller
parent
318f264a
Changes
2
Hide whitespace changes
Inline
Side-by-side
app/Http/Controllers/PadController.php
View file @
faf98b0c
...
...
@@ -901,6 +901,7 @@ class PadController extends Controller
public
function
generatePDF
(
$id
){
$user
=
Auth
::
user
();
$pad
=
Pad
::
find
(
$id
);
$userPadGeneratePDF
=
new
UserPadController
();
$professores
=
User
::
join
(
'user_pad'
,
'user_pad.user_id'
,
'='
,
'users.id'
)
->
join
(
'pad'
,
'user_pad.pad_id'
,
'='
,
'pad.id'
)
->
where
(
function
(
$query
)
use
(
$user
,
$id
)
{
...
...
@@ -932,7 +933,7 @@ class PadController extends Controller
$professor
->
ch_gestao
=
$this
->
get_carga_horaria
(
$avaliacoes
[
'gestao'
])
?
$this
->
get_carga_horaria
(
$avaliacoes
[
'gestao'
])
:
0
;
if
(
$professor
->
ch_ensino
||
$professor
->
ch_pesquisa
||
$professor
->
ch_extensao
||
$professor
->
ch_gestao
)
{
U
serPad
Controller
::
generatePDF
(
$userPad
->
{
'id'
});
$u
serPad
GeneratePDF
->
generatePDF
(
$userPad
->
{
'id'
});
}
}
...
...
app/Http/Controllers/UserPadController.php
View file @
faf98b0c
...
...
@@ -4,6 +4,7 @@ namespace App\Http\Controllers;
use
App\Models\Pad
;
use
App\Models\Curso
;
use
App\Models\Campus
;
use
App\Models\User
;
use
App\Models\UserPad
;
use
App\Models\Anexo
;
...
...
@@ -207,8 +208,11 @@ class UserPadController extends Controller
'GESTAO'
=>
$gestaoTotalHoras
,
'PESQUISA'
=>
$pesquisaTotalHoras
];
$anexoPad
=
Anexo
::
whereUserPadId
(
$user_pad_id
)
->
first
()
->
toArray
();
if
(
Anexo
::
whereUserPadId
(
$user_pad_id
)
->
first
()
!=
null
)
{
$anexoPad
=
Anexo
::
whereUserPadId
(
$user_pad_id
)
->
first
()
->
toArray
();
}
else
{
$anexoPad
=
null
;
}
$userPad
=
UserPad
::
whereId
(
$user_pad_id
)
->
first
();
$model
[
'ensino'
]
=
[
PadTables
::
tablesEnsino
(
$user_pad_id
)[
0
][
'name'
]
=>
$userPad
->
ensinoAulas
->
toArray
(),
...
...
@@ -319,7 +323,8 @@ class UserPadController extends Controller
}
elseif
(
$nome_valor
==
'campus_id'
)
{
$treated_anexo_pad
[
$nomes_valores
[
$nome_valor
]]
=
strtoupper
(
$unidades_ensino
[
$valor
]);
$treated_anexo_pad
[
$nomes_valores
[
$nome_valor
]]
=
Campus
::
whereId
(
$valor
)
->
first
()
->
{
'name'
};
$treated_anexo_pad
[
$nomes_valores
[
'unidade'
]]
=
$unidades_ensino
[
Campus
::
whereId
(
$valor
)
->
first
()
->
{
'unidade_id'
}];
}
elseif
(
$nome_valor
==
'curso_id'
)
{
...
...
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