Cronjob: SponsionJob: Sponsionsdatum als ZGV-Datum übernehmen

This commit is contained in:
ma0068
2022-09-23 15:32:56 +02:00
parent 8e6b9b7e5f
commit 11281c1e5f
3 changed files with 75 additions and 21 deletions
+30 -19
View File
@@ -3,7 +3,7 @@
* FH-Complete
*
*
* Cronjobs to be run for inserting the date of Sponsion as Date ZGV for further applications.
* Cronjobs to be run for inserting the date of Sponsion as Date ZGV of absolvents
*/
// ------------------------------------------------------------------------
@@ -20,29 +20,40 @@ class SponsionJob extends JOB_Controller
// Load models
$this->load->model('education/Abschlusspruefung_model', 'AbschlusspruefungModel');
// Load libraries
$this->load->library('PermissionLib');
// Load helpers
$this->load->helper('hlp_sancho_helper');
$this->load->model('crm/Prestudent_model', 'PrestudentModel');
}
public function insertDate()
{
$allAbsolventsWithDateSponsion = $this->AbschlusspruefungModel->getAbsolventsWithSponsionDate()->retval;
$count = 0;
$countBewerbungen = 0;
print_r("-----------------------------------------------------------------\n");
print_r("Cronjob START\n");
print_r("Sponsionsdatum als ZGV-Datum eintragen:\n");
foreach ($allAbsolventsWithDateSponsion as $absolvent)
{
$this->AbschlusspruefungModel->insertDatumSponsionAsZgvmadatum($absolvent->prestudent_id, $absolvent->sponsion);
//get all prestudents of person_id with Status Interessent
$allBewerbungen = $this->PrestudentModel->getPrestudentsOfPersonId($absolvent->person_id, 'Interessent')->retval;
foreach ($allBewerbungen as $bewerbung)
{
$this->AbschlusspruefungModel->insertDatumSponsionAsZgvmadatum($bewerbung->prestudent_id, $absolvent->sponsion);
print_r (" Bewerbung: personId: " . $absolvent->person_id . " prestudentId: " . $bewerbung->prestudent_id. " DateSponsion: " . $absolvent->sponsion."\n");
$countBewerbungen++;
}
$count++;
}
print_r("\nAnzahl Absolventen: " . $count);
print_r("\nAnzahl Inserts Bewerbungen: " . $countBewerbungen);
print_r("\nCronjob END\n");
print_r("-----------------------------------------------------------------\n");
return true;
}
//******************************************************************************************************************
// PRIVATE FUNCTIONS
//******************************************************************************************************************
private function getAbsolventsWithSponsion()
{
$mResult = $this->AbschlusspruefungModel->getAbsolventsWithSponsionDate();
$absolventList = getData($mResult);
// $vorgesetzte = array();
// $toSend = array();
}
}