Skip to content

Commit

Permalink
fix: correção sagres status dos alunos
Browse files Browse the repository at this point in the history
  • Loading branch information
igorgoncalves committed Dec 23, 2024
1 parent b4d4f90 commit c6a579c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
13 changes: 12 additions & 1 deletion app/modules/sagres/models/SagresConsultModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -1590,6 +1590,16 @@ public function getEnrollments($classId, $referenceYear, $month, $finalClass, $i
$strlen = 5;
$school = (object) \SchoolIdentification::model()->findByAttributes(array('inep_id' => $inepId));

$acceptedStatus = [
\StudentEnrollment::getStatusId(\StudentEnrollment::STATUS_ACTIVE),
\StudentEnrollment::getStatusId(\StudentEnrollment::STATUS_APPROVED),
\StudentEnrollment::getStatusId(\StudentEnrollment::STATUS_APPROVEDBYCOUNCIL),
\StudentEnrollment::getStatusId(\StudentEnrollment::STATUS_DISAPPROVED),
];

$strAcceptedStatus = implode( ",", $acceptedStatus);


$query = "SELECT
c.edcenso_stage_vs_modality_fk,
c.modality,
Expand Down Expand Up @@ -1633,13 +1643,14 @@ public function getEnrollments($classId, $referenceYear, $month, $finalClass, $i
left join schedule s on cf.schedule_fk = s.id
WHERE
se.classroom_fk = :classId AND
(se.status = 1 or se.status is null) AND
(se.status in (:statusList) or se.status is null) AND
c.school_year = :referenceYear
GROUP BY se.id;
";

$command = Yii::app()->db->createCommand($query);
$command->bindValues([
':statusList' => $strAcceptedStatus,
':classId' => $classId,
':referenceYear' => $referenceYear,
]);
Expand Down
Loading

0 comments on commit c6a579c

Please sign in to comment.