Commit d0a258584458a4b5fcd4b5166ccd7bcf8b04a98c
1 parent
20288e28
Exists in
2.8
and in
6 other branches
Torna método mais performático
Showing
2 changed files
with
5 additions
and
6 deletions
Show diff stats
ieducar/lib/App/Model/IedFinder.php
... | ... | @@ -1504,16 +1504,15 @@ class App_Model_IedFinder extends CoreExt_Entity |
1504 | 1504 | $stages = []; |
1505 | 1505 | |
1506 | 1506 | $sql = ' |
1507 | - SELECT distinct etapa | |
1507 | + SELECT distinct etapa, ref_cod_disciplina | |
1508 | 1508 | FROM pmieducar.dispensa_disciplina |
1509 | 1509 | JOIN pmieducar.dispensa_etapa |
1510 | 1510 | ON dispensa_disciplina.cod_dispensa = dispensa_etapa.ref_cod_dispensa |
1511 | 1511 | WHERE ref_cod_matricula = $1 |
1512 | - AND ref_cod_disciplina = $2 | |
1513 | 1512 | order by etapa |
1514 | 1513 | '; |
1515 | 1514 | |
1516 | - $query = Portabilis_Utils_Database::fetchPreparedQuery($sql, ['params' => [$enrollmentId, $disciplineId]]); | |
1515 | + $query = Portabilis_Utils_Database::fetchPreparedQuery($sql, ['params' => [$enrollmentId]]); | |
1517 | 1516 | |
1518 | 1517 | foreach ($query as $stage) { |
1519 | 1518 | $stages[] = $stage; | ... | ... |
ieducar/modules/Avaliacao/Service/Boletim.php
... | ... | @@ -64,11 +64,11 @@ class Avaliacao_Service_Boletim implements CoreExt_Configurable |
64 | 64 | |
65 | 65 | private function getExemptedStages($enrollmentId, $disciplineId) |
66 | 66 | { |
67 | - if (!isset($this->exemptedStages[$disciplineId])) { | |
68 | - $this->exemptedStages[$disciplineId] = App_Model_IedFinder::getExemptedStages($enrollmentId, $disciplineId); | |
67 | + if (!isset($this->exemptedStages[$enrollmentId])) { | |
68 | + $this->exemptedStages[$enrollmentId] = App_Model_IedFinder::getExemptedStages($enrollmentId, $disciplineId); | |
69 | 69 | } |
70 | 70 | |
71 | - return $this->exemptedStages[$disciplineId]; | |
71 | + return $this->exemptedStages[$enrollmentId][$disciplineId] ?? []; | |
72 | 72 | } |
73 | 73 | |
74 | 74 | /** | ... | ... |