mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-06-01 12:19:28 +00:00
Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 35528c54cd |
@@ -2420,11 +2420,11 @@ class InfoCenter extends Auth_Controller
|
||||
if ($statusgrund === 'null' || $studiengang === 'null' || $abgeschickt === 'null' || empty($personen))
|
||||
$this->terminateWithJsonError("Bitte füllen Sie alle Felder aus");
|
||||
|
||||
if ($studiengang === 'all' && $abgeschickt === 'all')
|
||||
if ($studiengang === 'all')
|
||||
{
|
||||
foreach($personen as $person)
|
||||
{
|
||||
$prestudenten = $this->PrestudentModel->getByPersonWithoutLehrgang($person, $studienSemester);
|
||||
$prestudenten = $this->PrestudentModel->getByPersonWithoutLehrgang($person, $studienSemester, $abgeschickt, $abgeschickt === 'all');
|
||||
|
||||
if (!hasData($prestudenten))
|
||||
continue;
|
||||
|
||||
@@ -693,7 +693,7 @@ class Prestudent_model extends DB_Model
|
||||
|
||||
if (!$ignoreAbgeschickt)
|
||||
{
|
||||
$query .= "AND";
|
||||
$query .= " AND";
|
||||
|
||||
if ($abgeschickt === 'true')
|
||||
$query .= " EXISTS";
|
||||
@@ -709,7 +709,7 @@ class Prestudent_model extends DB_Model
|
||||
return $this->execQuery($query, array($person, $studiengang, $studienSemester));
|
||||
}
|
||||
|
||||
public function getByPersonWithoutLehrgang($person, $studienSemester)
|
||||
public function getByPersonWithoutLehrgang($person, $studienSemester, $abgeschickt, $ignoreAbgeschickt = false)
|
||||
{
|
||||
$query = "SELECT DISTINCT(ps.prestudent_id)
|
||||
FROM public.tbl_prestudentstatus pss
|
||||
@@ -721,6 +721,21 @@ class Prestudent_model extends DB_Model
|
||||
AND (sg.typ = 'b' OR sg.typ = 'm')
|
||||
AND pss.studiensemester_kurzbz = ?";
|
||||
|
||||
if (!$ignoreAbgeschickt)
|
||||
{
|
||||
$query .= " AND";
|
||||
|
||||
if ($abgeschickt === 'true')
|
||||
$query .= " EXISTS";
|
||||
else
|
||||
$query .= " NOT EXISTS";
|
||||
|
||||
$query .= " (SELECT 1 FROM public.tbl_prestudentstatus spss
|
||||
JOIN public.tbl_prestudent sps USING(prestudent_id)
|
||||
WHERE sps.prestudent_id = ps.prestudent_id
|
||||
AND spss.bewerbung_abgeschicktamum IS NOT NULL)";
|
||||
}
|
||||
|
||||
return $this->execQuery($query, array($person, $studienSemester));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user