Merge branch 'getschoolsbug' into 'develop'

pdebug

See merge request !246
parents 858eee2f 05235f8d
...@@ -611,8 +611,10 @@ class DirectorView extends ControllerBase ...@@ -611,8 +611,10 @@ class DirectorView extends ControllerBase
$SchoolCat = reset($SchoolCats); $SchoolCat = reset($SchoolCats);
if ($SchoolCat) { if ($SchoolCat) {
$categ = $SchoolCat->metathesis_region->value; $categ = $SchoolCat->metathesis_region->value;
$operation_shift = $school -> operation_shift -> value;
} else { } else {
$categ = '-'; $categ = '-';
$operation_shift ='-';
} }
$CourseA = $this->entityTypeManager->getStorage('epal_student')->loadByProperties(array('id' => $schoolid)); $CourseA = $this->entityTypeManager->getStorage('epal_student')->loadByProperties(array('id' => $schoolid));
...@@ -668,6 +670,30 @@ class DirectorView extends ControllerBase ...@@ -668,6 +670,30 @@ class DirectorView extends ControllerBase
} }
} }
if ($operation_shift == 'ΕΣΠΕΡΙΝΟ')
{
$limit = $this->getLimit(4, $categ);
$sCon = $this->connection->select('eepal_specialties_in_epal_field_data', 'eSchool');
$sCon->leftJoin('epal_student_class', 'eStudent',
'eStudent.epal_id = ' . $schoolid . ' ' .
'AND eStudent.specialization_id = eSchool.specialty_id ' .
'AND eStudent.currentclass = 4');
$sCon->fields('eSchool', array('specialty_id'))
->fields('eStudent', array('specialization_id'))
->groupBy('specialization_id')
->groupBy('specialty_id')
->condition('eSchool.epal_id', $schoolid, '=');
$sCon->addExpression('count(eStudent.id)', 'eStudent_count');
$results = $sCon->execute()->fetchAll(\PDO::FETCH_OBJ);
foreach ($results as $result) {
if ($result->eStudent_count < $limit) {
return false;
}
}
}
return true; return true;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment