From 1bc8e08f574eb435e20c44b0fae01bf5b06d72d8 Mon Sep 17 00:00:00 2001 From: Eder Soares Date: Thu, 3 Oct 2019 11:16:02 -0300 Subject: [PATCH 01/10] =?UTF-8?q?Colore=20situa=C3=A7=C3=A3o=20diferenciad?= =?UTF-8?q?a=20da=20matr=C3=ADcula=20no=20lan=C3=A7amento=20de=20notas?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/assets.php | 2 +- ieducar/intranet/styles/custom.css | 4 ++++ ieducar/modules/Avaliacao/Assets/Javascripts/Diario.js | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/config/assets.php b/config/assets.php index 1bb81e98bd..5baccb31c9 100644 --- a/config/assets.php +++ b/config/assets.php @@ -14,7 +14,7 @@ | */ - 'version' => '0.0.34', + 'version' => '0.0.35', /* |-------------------------------------------------------------------------- diff --git a/ieducar/intranet/styles/custom.css b/ieducar/intranet/styles/custom.css index bfd0d6dda5..8e64b08a35 100644 --- a/ieducar/intranet/styles/custom.css +++ b/ieducar/intranet/styles/custom.css @@ -1314,3 +1314,7 @@ a.btn-detalhes { cursor: pointer; white-space: nowrap; } + +.matricula-situacao-deslocamento { + color: #FF6600; +} diff --git a/ieducar/modules/Avaliacao/Assets/Javascripts/Diario.js b/ieducar/modules/Avaliacao/Assets/Javascripts/Diario.js index cb9b7d0339..eac7b5903c 100644 --- a/ieducar/modules/Avaliacao/Assets/Javascripts/Diario.js +++ b/ieducar/modules/Avaliacao/Assets/Javascripts/Diario.js @@ -1088,7 +1088,7 @@ function handleSearch($resultTable, dataResponse) { .attr('id', 'situacao-matricula-' + value.matricula_id) .data('matricula_id', value.matricula_id) .addClass('center') - .css('color', '#FF6600') + .addClass('matricula-situacao-deslocamento') .html(value.situacao_deslocamento) .appendTo($linha); From 490bc0a908e77bbab66f2a0169f88e8893de81cd Mon Sep 17 00:00:00 2001 From: bonot Date: Thu, 10 Oct 2019 14:11:19 -0300 Subject: [PATCH 02/10] Desconsidera disciplina dispensada da turma --- ieducar/lib/App/Model/IedFinder.php | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/ieducar/lib/App/Model/IedFinder.php b/ieducar/lib/App/Model/IedFinder.php index 30f62f1aee..36d263c9a8 100644 --- a/ieducar/lib/App/Model/IedFinder.php +++ b/ieducar/lib/App/Model/IedFinder.php @@ -671,11 +671,13 @@ public static function getComponentesTurma( $where['componente_curricular_id'] = $componenteCurricularId; } + $disciplinaDispensada = self::disciplinaDispensadaDaTurma($turma); + $componentesTurma = $mapper->findAll([], $where); // Não existem componentes específicos para a turma if (0 == count($componentesTurma)) { - return self::getEscolaSerieDisciplina( + $componentesTurma = self::getEscolaSerieDisciplina( $serieId, $escola, $componenteMapper, @@ -684,6 +686,9 @@ public static function getComponentesTurma( $trazerDetalhes, $ano ); + + unset($componentesTurma[$disciplinaDispensada]); + return $componentesTurma; } $componentes = []; @@ -1101,6 +1106,23 @@ public static function getDisciplinasDispensadasPorMatricula( return $disciplinasDispensa; } + public static function disciplinaDispensadaDaTurma($codTurma) + { + if (!$codTurma) { + return; + } + + $sql = " + SELECT ref_cod_disciplina_dispensada + FROM pmieducar.turma + WHERE cod_turma = $1; + "; + + $disciplinaDispensada = Portabilis_Utils_Database::fetchPreparedQuery($sql, ['params' => $codTurma]); + + return $disciplinaDispensada[0]['ref_cod_disciplina_dispensada']; + } + public static function validaDispensaPorMatricula( $codMatricula, $codSerie, From 240bfda00c1f92cbeaf231079ac5b4e230f5673a Mon Sep 17 00:00:00 2001 From: bonot Date: Thu, 10 Oct 2019 15:35:34 -0300 Subject: [PATCH 03/10] Atualiza nome do curso superior de acordo com a tabela do educacenso --- ...10_151206_update_higher_education_name.php | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100755 database/migrations/2019_10_10_151206_update_higher_education_name.php diff --git a/database/migrations/2019_10_10_151206_update_higher_education_name.php b/database/migrations/2019_10_10_151206_update_higher_education_name.php new file mode 100755 index 0000000000..f37d5805b8 --- /dev/null +++ b/database/migrations/2019_10_10_151206_update_higher_education_name.php @@ -0,0 +1,30 @@ +where('curso_id', '145F15') + ->update(['nome' => 'Letras - Língua Portuguesa - Licenciatura']); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + // + } +} From 75611355e1bcd700951b49387b797323629f49ee Mon Sep 17 00:00:00 2001 From: bonot Date: Fri, 11 Oct 2019 14:46:30 -0300 Subject: [PATCH 04/10] Atualiza nomes dos cursos superiores --- ...10_151206_update_higher_education_name.php | 31 +++++++++++++++++-- 1 file changed, 28 insertions(+), 3 deletions(-) diff --git a/database/migrations/2019_10_10_151206_update_higher_education_name.php b/database/migrations/2019_10_10_151206_update_higher_education_name.php index f37d5805b8..3467c2d5d0 100755 --- a/database/migrations/2019_10_10_151206_update_higher_education_name.php +++ b/database/migrations/2019_10_10_151206_update_higher_education_name.php @@ -13,9 +13,34 @@ class UpdateHigherEducationName extends Migration */ public function up() { - DB::table('modules.educacenso_curso_superior') - ->where('curso_id', '145F15') - ->update(['nome' => 'Letras - Língua Portuguesa - Licenciatura']); + DB::update(" + UPDATE modules.educacenso_curso_superior + SET nome = CASE curso_id + WHEN '142C01' THEN 'Pedagogia (Ciências da Educação)' + WHEN '145F01' THEN 'Ciências Biológicas' + WHEN '145F02' THEN 'Ciências Naturais' + WHEN '145F05' THEN 'Educação Religiosa' + WHEN '145F08' THEN 'Filosofia' + WHEN '145F09' THEN 'Física' + WHEN '145F10' THEN 'Geografia' + WHEN '145F11' THEN 'História' + WHEN '145F15' THEN 'Letras - Língua Portuguesa' + WHEN '145F18' THEN 'Matemática' + WHEN '145F21' THEN 'Química' + WHEN '145F24' THEN 'Ciências Sociais' + WHEN '146P01' THEN 'Licenciatura para a Educação Profissional e Tecnológica' + WHEN '210A01' THEN 'Bacharelado Interdisciplinar em Artes' + WHEN '220H01' THEN 'Bacharelado Interdisciplinar Ciências Humanas' + WHEN '314E02' THEN 'Ciências Econômicas' + WHEN '623E01' THEN 'Engenharia Florestal' + WHEN '720S01' THEN 'Bacharelado Interdisciplinar Ciências da Saúde' + END + WHERE curso_id IN ( + '142C01', '145F01', '145F02', '145F05', '145F08', '145F09', + '145F10', '145F11', '145F18', '145F21', '145F24', '146P01', + '210A01', '220H01', '314E02', '623E01', '720S01', '145F15' + ) + "); } /** From 1c71d1c7bd78148043e90715ae22f71487e794a0 Mon Sep 17 00:00:00 2001 From: bonot Date: Fri, 11 Oct 2019 15:31:47 -0300 Subject: [PATCH 05/10] Usa model para consultar disciplina dispensada --- ieducar/lib/App/Model/IedFinder.php | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/ieducar/lib/App/Model/IedFinder.php b/ieducar/lib/App/Model/IedFinder.php index 36d263c9a8..5b806d70df 100644 --- a/ieducar/lib/App/Model/IedFinder.php +++ b/ieducar/lib/App/Model/IedFinder.php @@ -3,6 +3,7 @@ use App\Models\LegacyDiscipline; use App\Models\LegacyDisciplineAcademicYear; use App\Models\LegacySchool; +use App\Models\LegacySchoolClass; use iEducar\Modules\Enrollments\Exceptions\StudentNotEnrolledInSchoolClass; use iEducar\Modules\AcademicYear\Exceptions\DisciplineNotLinkedToRegistrationException; use iEducar\Modules\EvaluationRules\Exceptions\EvaluationRuleNotDefinedInLevel; @@ -1112,15 +1113,9 @@ public static function disciplinaDispensadaDaTurma($codTurma) return; } - $sql = " - SELECT ref_cod_disciplina_dispensada - FROM pmieducar.turma - WHERE cod_turma = $1; - "; - - $disciplinaDispensada = Portabilis_Utils_Database::fetchPreparedQuery($sql, ['params' => $codTurma]); - - return $disciplinaDispensada[0]['ref_cod_disciplina_dispensada']; + $schoolClass = LegacySchoolClass::query()->find($codTurma); + $disciplinaDispensada = $schoolClass->ref_cod_disciplina_dispensada; + return $disciplinaDispensada; } public static function validaDispensaPorMatricula( From d76c716f81afc8c27fb8cf04362e3e72c06881a8 Mon Sep 17 00:00:00 2001 From: bonot Date: Fri, 11 Oct 2019 16:06:41 -0300 Subject: [PATCH 06/10] Cria cache para consulta de disciplina dispensada --- ieducar/lib/App/Model/IedFinder.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/ieducar/lib/App/Model/IedFinder.php b/ieducar/lib/App/Model/IedFinder.php index 5b806d70df..4120b3434a 100644 --- a/ieducar/lib/App/Model/IedFinder.php +++ b/ieducar/lib/App/Model/IedFinder.php @@ -1113,9 +1113,11 @@ public static function disciplinaDispensadaDaTurma($codTurma) return; } - $schoolClass = LegacySchoolClass::query()->find($codTurma); - $disciplinaDispensada = $schoolClass->ref_cod_disciplina_dispensada; - return $disciplinaDispensada; + return Cache::store('array')->remember("disciplinaDispensadaDaTurma:{$codTurma}", now()->addMinute(), function () use ($codTurma) { + $schoolClass = LegacySchoolClass::query()->find($codTurma); + $disciplinaDispensada = $schoolClass->ref_cod_disciplina_dispensada; + return $disciplinaDispensada; + }); } public static function validaDispensaPorMatricula( From 16bcf3dd7334c7b32599ac9e0dcf8487d5712ad6 Mon Sep 17 00:00:00 2001 From: bonot Date: Fri, 11 Oct 2019 16:56:30 -0300 Subject: [PATCH 07/10] Ajusta cache para prever retornos nulos --- ieducar/lib/App/Model/IedFinder.php | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/ieducar/lib/App/Model/IedFinder.php b/ieducar/lib/App/Model/IedFinder.php index 4120b3434a..af2abd5287 100644 --- a/ieducar/lib/App/Model/IedFinder.php +++ b/ieducar/lib/App/Model/IedFinder.php @@ -1113,11 +1113,19 @@ public static function disciplinaDispensadaDaTurma($codTurma) return; } - return Cache::store('array')->remember("disciplinaDispensadaDaTurma:{$codTurma}", now()->addMinute(), function () use ($codTurma) { - $schoolClass = LegacySchoolClass::query()->find($codTurma); - $disciplinaDispensada = $schoolClass->ref_cod_disciplina_dispensada; - return $disciplinaDispensada; + $discipline = Cache::store('array')->remember("disciplinaDispensadaDaTurma:{$codTurma}", now()->addMinute(), function () use ($codTurma) { + $discipline = LegacySchoolClass::query()->find($codTurma)->ref_cod_disciplina_dispensada; + + // Caso não exista a disciplina, armazena a string 'null' + return $discipline ?: 'null'; }); + + // Se o retorno é uma string 'null', sabemos o que o valor real é null + if ($discipline === 'null') { + return null; + } + + return $discipline; } public static function validaDispensaPorMatricula( From 53e2a51513f61f554d38dbe515045851f6d21807 Mon Sep 17 00:00:00 2001 From: Eder Soares Date: Mon, 14 Oct 2019 10:46:25 -0300 Subject: [PATCH 08/10] Adiciona os campos latitude e longitude no cadastro de escola --- ieducar/intranet/educar_escola_cad.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/ieducar/intranet/educar_escola_cad.php b/ieducar/intranet/educar_escola_cad.php index 9cabb98a99..894af4077b 100644 --- a/ieducar/intranet/educar_escola_cad.php +++ b/ieducar/intranet/educar_escola_cad.php @@ -115,6 +115,8 @@ class indice extends clsCadastro public $situacao_funcionamento; public $dependencia_administrativa; public $orgao_vinculado_escola; + public $latitude; + public $longitude; public $regulamentacao; public $gestor_id; public $cargo_gestor; @@ -866,6 +868,9 @@ public function Gerar() $this->campoOculto("passou", $this->passou); } + $this->inputsHelper()->numeric('latitude', array('max_length' => '20', 'size' => '20', 'required' => false, 'value' => $this->latitude, 'label_hint' => 'São aceito somente números, ponto "." e hífen "-"')); + $this->inputsHelper()->numeric('longitude', array('max_length' => '20', 'size' => '20', 'required' => false, 'value' => $this->longitude, 'label_hint' => 'São aceito somente números, ponto "." e hífen "-"')); + $this->campoCheck("bloquear_lancamento_diario_anos_letivos_encerrados", "Bloquear lançamento no diário para anos letivos encerrados", $this->bloquear_lancamento_diario_anos_letivos_encerrados); $this->campoCheck("utiliza_regra_diferenciada", "Utiliza regra diferenciada", dbBool($this->utiliza_regra_diferenciada), '', false, false, false, 'Se marcado, utilizará regra de avaliação diferenciada informada na Série'); @@ -1696,6 +1701,8 @@ public function Novo() $obj->situacao_funcionamento = $this->situacao_funcionamento; $obj->dependencia_administrativa = $this->dependencia_administrativa; $obj->orgao_vinculado_escola = $orgao_vinculado_escola; + $obj->latitude = $this->latitude; + $obj->longitude = $this->longitude; $obj->regulamentacao = $this->regulamentacao; $obj->ref_idpes_gestor = $this->gestor_id; $obj->cargo_gestor = $this->cargo_gestor; @@ -1860,6 +1867,8 @@ public function Novo() $obj = new clsPmieducarEscola(null, $this->pessoa_logada, null, $this->ref_cod_instituicao, $this->zona_localizacao, $this->ref_cod_escola_rede_ensino, null, $this->sigla, null, null, 1, null, $this->bloquear_lancamento_diario_anos_letivos_encerrados, $this->utiliza_regra_diferenciada); $obj->dependencia_administrativa = $this->dependencia_administrativa; $obj->orgao_vinculado_escola = $orgao_vinculado_escola; + $obj->latitude = $this->latitude; + $obj->longitude = $this->longitude; $obj->regulamentacao = $this->regulamentacao; $obj->situacao_funcionamento = $this->situacao_funcionamento; $obj->ref_idpes_gestor = $this->gestor_id; @@ -2064,6 +2073,8 @@ public function Editar() $obj = new clsPmieducarEscola($this->cod_escola, null, $this->pessoa_logada, $this->ref_cod_instituicao, $this->zona_localizacao, $this->ref_cod_escola_rede_ensino, $this->ref_idpes, $this->sigla, null, null, 1, $this->bloquear_lancamento_diario_anos_letivos_encerrados, $this->utiliza_regra_diferenciada); $obj->dependencia_administrativa = $this->dependencia_administrativa; $obj->orgao_vinculado_escola = $orgao_vinculado_escola; + $obj->latitude = $this->latitude; + $obj->longitude = $this->longitude; $obj->regulamentacao = $this->regulamentacao; $obj->situacao_funcionamento = $this->situacao_funcionamento; $obj->ref_idpes_gestor = $this->gestor_id; @@ -2157,6 +2168,8 @@ public function Editar() $obj->situacao_funcionamento = $this->situacao_funcionamento; $obj->dependencia_administrativa = $this->dependencia_administrativa; $obj->orgao_vinculado_escola = $orgao_vinculado_escola; + $obj->latitude = $this->latitude; + $obj->longitude = $this->longitude; $obj->regulamentacao = $this->regulamentacao; $obj->ref_idpes_gestor = $this->gestor_id; $obj->cargo_gestor = $this->cargo_gestor; From 2247b0dc175128b6b3e3f28011987084ce274970 Mon Sep 17 00:00:00 2001 From: Eder Soares Date: Fri, 18 Oct 2019 20:15:52 -0300 Subject: [PATCH 09/10] Version --- composer.json | 2 +- composer.lock | 50 +++++++++++++++++++++++++------------------------- 2 files changed, 26 insertions(+), 26 deletions(-) diff --git a/composer.json b/composer.json index a7d28f53fc..2937d052b3 100644 --- a/composer.json +++ b/composer.json @@ -3,7 +3,7 @@ "description": "Software livre de gestão escolar", "type": "project", "license": "GPL-2.0-or-later", - "version": "2.2.9", + "version": "2.2.10", "keywords": [ "Portabilis", "i-Educar" diff --git a/composer.lock b/composer.lock index 01f40a9f88..feb6086de9 100644 --- a/composer.lock +++ b/composer.lock @@ -4,20 +4,20 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "b03e79b5d95d52de66fbe631b2bc6f71", + "content-hash": "b809688eaf9970067bfc1abc85b1a398", "packages": [ { "name": "aws/aws-sdk-php", - "version": "3.112.19", + "version": "3.112.25", "source": { "type": "git", "url": "https://github.com/aws/aws-sdk-php.git", - "reference": "8e69a518ff058612b94d328c2cde644621a4c0cc" + "reference": "f91e264e3cbf8ced5c93f5f786c9e0f079926749" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/8e69a518ff058612b94d328c2cde644621a4c0cc", - "reference": "8e69a518ff058612b94d328c2cde644621a4c0cc", + "url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/f91e264e3cbf8ced5c93f5f786c9e0f079926749", + "reference": "f91e264e3cbf8ced5c93f5f786c9e0f079926749", "shasum": "" }, "require": { @@ -87,7 +87,7 @@ "s3", "sdk" ], - "time": "2019-10-10T18:23:11+00:00" + "time": "2019-10-18T18:08:55+00:00" }, { "name": "cocur/slugify", @@ -1522,16 +1522,16 @@ }, { "name": "league/flysystem", - "version": "1.0.55", + "version": "1.0.57", "source": { "type": "git", "url": "https://github.com/thephpleague/flysystem.git", - "reference": "33c91155537c6dc899eacdc54a13ac6303f156e6" + "reference": "0e9db7f0b96b9f12dcf6f65bc34b72b1a30ea55a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/flysystem/zipball/33c91155537c6dc899eacdc54a13ac6303f156e6", - "reference": "33c91155537c6dc899eacdc54a13ac6303f156e6", + "url": "https://api.github.com/repos/thephpleague/flysystem/zipball/0e9db7f0b96b9f12dcf6f65bc34b72b1a30ea55a", + "reference": "0e9db7f0b96b9f12dcf6f65bc34b72b1a30ea55a", "shasum": "" }, "require": { @@ -1602,7 +1602,7 @@ "sftp", "storage" ], - "time": "2019-08-24T11:17:19+00:00" + "time": "2019-10-16T21:01:05+00:00" }, { "name": "league/flysystem-aws-s3-v3", @@ -2065,16 +2065,16 @@ }, { "name": "nesbot/carbon", - "version": "2.25.1", + "version": "2.25.2", "source": { "type": "git", "url": "https://github.com/briannesbitt/Carbon.git", - "reference": "d59c6cea9c4a3547bb6c0dfec451319abdaa4fb1" + "reference": "443fe5f1498147e0fbc792142b5dc43e2e8a533f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/d59c6cea9c4a3547bb6c0dfec451319abdaa4fb1", - "reference": "d59c6cea9c4a3547bb6c0dfec451319abdaa4fb1", + "url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/443fe5f1498147e0fbc792142b5dc43e2e8a533f", + "reference": "443fe5f1498147e0fbc792142b5dc43e2e8a533f", "shasum": "" }, "require": { @@ -2128,7 +2128,7 @@ "datetime", "time" ], - "time": "2019-10-05T15:52:23+00:00" + "time": "2019-10-14T14:18:59+00:00" }, { "name": "nikic/php-parser", @@ -5337,25 +5337,25 @@ }, { "name": "maximebf/debugbar", - "version": "v1.15.0", + "version": "v1.15.1", "source": { "type": "git", "url": "https://github.com/maximebf/php-debugbar.git", - "reference": "30e7d60937ee5f1320975ca9bc7bcdd44d500f07" + "reference": "6c4277f6117e4864966c9cb58fb835cee8c74a1e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/maximebf/php-debugbar/zipball/30e7d60937ee5f1320975ca9bc7bcdd44d500f07", - "reference": "30e7d60937ee5f1320975ca9bc7bcdd44d500f07", + "url": "https://api.github.com/repos/maximebf/php-debugbar/zipball/6c4277f6117e4864966c9cb58fb835cee8c74a1e", + "reference": "6c4277f6117e4864966c9cb58fb835cee8c74a1e", "shasum": "" }, "require": { - "php": ">=5.3.0", + "php": ">=5.6", "psr/log": "^1.0", - "symfony/var-dumper": "^2.6|^3.0|^4.0" + "symfony/var-dumper": "^2.6|^3|^4" }, "require-dev": { - "phpunit/phpunit": "^4.0|^5.0" + "phpunit/phpunit": "^5" }, "suggest": { "kriswallsmith/assetic": "The best way to manage assets", @@ -5365,7 +5365,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.14-dev" + "dev-master": "1.15-dev" } }, "autoload": { @@ -5394,7 +5394,7 @@ "debug", "debugbar" ], - "time": "2017-12-15T11:13:46+00:00" + "time": "2019-09-24T14:55:42+00:00" }, { "name": "mockery/mockery", From 7c8ee87a83733e5bc2934bf47425b22a5b786da3 Mon Sep 17 00:00:00 2001 From: Eder Soares Date: Mon, 21 Oct 2019 09:33:48 -0300 Subject: [PATCH 10/10] =?UTF-8?q?Retorna=20null=20quando=20turma=20n=C3=A3?= =?UTF-8?q?o=20for=20encontrada=20na=20dispensa?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ieducar/lib/App/Model/IedFinder.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/ieducar/lib/App/Model/IedFinder.php b/ieducar/lib/App/Model/IedFinder.php index af2abd5287..f1eda8f0ea 100644 --- a/ieducar/lib/App/Model/IedFinder.php +++ b/ieducar/lib/App/Model/IedFinder.php @@ -1113,18 +1113,18 @@ public static function disciplinaDispensadaDaTurma($codTurma) return; } - $discipline = Cache::store('array')->remember("disciplinaDispensadaDaTurma:{$codTurma}", now()->addMinute(), function () use ($codTurma) { - $discipline = LegacySchoolClass::query()->find($codTurma)->ref_cod_disciplina_dispensada; - + $discipline = Cache::store('array')->remember("disciplinaDispensadaDaTurma:{$codTurma}", now()->addMinute(), function () use ($codTurma) { + $discipline = LegacySchoolClass::query()->find($codTurma)->ref_cod_disciplina_dispensada ?? null; + // Caso não exista a disciplina, armazena a string 'null' return $discipline ?: 'null'; }); - + // Se o retorno é uma string 'null', sabemos o que o valor real é null if ($discipline === 'null') { return null; } - + return $discipline; }