Commit 55ecae2de3f0be04742e3300a86096bdbf26fe6d

Authored by Edinei Valdameri
Committed by GitHub
2 parents 530c85de 582dadd4
Exists in 2.9 and in 1 other branch 2.8

Merge pull request #9643 from portabilis/issue-3785

Altera escopo e builder do LegacyEnrollment
app/Models/Builders/LegacyEnrollmentBuilder.php
@@ -56,4 +56,16 @@ class LegacyEnrollmentBuilder extends LegacyBuilder @@ -56,4 +56,16 @@ class LegacyEnrollmentBuilder extends LegacyBuilder
56 { 56 {
57 return $this->where('ref_cod_turma', $schoolClass); 57 return $this->where('ref_cod_turma', $schoolClass);
58 } 58 }
  59 +
  60 + public function addJoinViewSituacaoRelatorios(int $situation): self
  61 + {
  62 + return $this->join('relatorio.view_situacao_relatorios', function($join) use ($situation) {
  63 + $join->on('view_situacao_relatorios.cod_matricula', 'ref_cod_matricula');
  64 + $join->on('view_situacao_relatorios.cod_turma', 'ref_cod_turma');
  65 + $join->on('view_situacao_relatorios.sequencial', 'matricula_turma.sequencial');
  66 + $join->where('view_situacao_relatorios.cod_situacao', $situation);
  67 + })->addSelect([
  68 + 'view_situacao_relatorios.texto_situacao'
  69 + ]);
  70 + }
59 } 71 }
app/Models/LegacyEnrollment.php
@@ -167,9 +167,4 @@ class LegacyEnrollment extends LegacyModel @@ -167,9 +167,4 @@ class LegacyEnrollment extends LegacyModel
167 { 167 {
168 return $this->registration->student->cod_aluno; 168 return $this->registration->student->cod_aluno;
169 } 169 }
170 -  
171 - public function situations(): HasMany  
172 - {  
173 - return $this->hasMany(SituationReport::class, 'cod_matricula', 'ref_cod_matricula');  
174 - }  
175 } 170 }