Commit 33566d5bfa379690f4e7fca6d6fe82b4e7e6bb34

Authored by Everton Muniz
1 parent a253550d
Exists in 2.9 and in 7 other branches 2.2, 2.3, 2.4, 2.5, 2.6, 2.7, 2.8

Altera endpoint de unficações de alunos para receber várias escolas

Showing 1 changed file with 5 additions and 5 deletions   Show diff stats
ieducar/modules/Api/Views/AlunoController.php
@@ -1965,12 +1965,12 @@ class AlunoController extends ApiCoreController @@ -1965,12 +1965,12 @@ class AlunoController extends ApiCoreController
1965 return; 1965 return;
1966 } 1966 }
1967 1967
1968 - $escolaId = $this->getRequest()->escola_id; 1968 + $arrayEscola = explode(',', $this->getRequest()->escola);
1969 1969
1970 $unificationsQuery = LogUnification::query(); 1970 $unificationsQuery = LogUnification::query();
1971 - $unificationsQuery->whereHas('studentMain', function ($studentQuery) use ($escolaId) {  
1972 - $studentQuery->whereHas('registrations', function ($registrationsQuery) use ($escolaId){  
1973 - $registrationsQuery->where('school_id', $escolaId); 1971 + $unificationsQuery->whereHas('studentMain', function ($studentQuery) use ($arrayEscola) {
  1972 + $studentQuery->whereHas('registrations', function ($registrationsQuery) use ($arrayEscola){
  1973 + $registrationsQuery->whereIn('school_id', $arrayEscola);
1974 }); 1974 });
1975 }); 1975 });
1976 1976
@@ -1979,7 +1979,7 @@ class AlunoController extends ApiCoreController @@ -1979,7 +1979,7 @@ class AlunoController extends ApiCoreController
1979 1979
1980 protected function canGetUnificacoes() 1980 protected function canGetUnificacoes()
1981 { 1981 {
1982 - return $this->validatesPresenceOf('escola_id'); 1982 + return $this->validatesPresenceOf('escola');
1983 } 1983 }
1984 1984
1985 public function Gerar() 1985 public function Gerar()