mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-16 22:42:16 +00:00
poc move logic for single tags to libs, and add lib loading path and name to extra column in tbl_notiztyp
This commit is contained in:
@@ -37,6 +37,23 @@ class TagJob extends JOB_Controller
|
||||
]);
|
||||
}
|
||||
|
||||
public function pocTagLibs()
|
||||
{
|
||||
$automatedTagsRes = $this->NotiztypModel->loadWhere(array('automatisiert' => true, 'taglib IS NOT NULL' => null));
|
||||
//echo $this->NotiztypModel->db->last_query();
|
||||
$automatedTags = hasData($automatedTagsRes) ? getData($automatedTagsRes) : [];
|
||||
print_r($automatedTags);
|
||||
|
||||
foreach($automatedTags as $autoTag)
|
||||
{
|
||||
$taglib = strtolower(basename($autoTag->taglib));
|
||||
$this->load->library($autoTag->taglib);
|
||||
|
||||
$ids = $this->$taglib->getZuordnungIds(array('studiensemester_kurzbz' => 'SS2026'));
|
||||
print_r($ids);
|
||||
}
|
||||
}
|
||||
|
||||
public function rebuildAutomatedTags()
|
||||
{
|
||||
print_r( PHP_EOL . "Start Job rebuild" . PHP_EOL);
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
/**
|
||||
* Description of wh_auto
|
||||
*
|
||||
* @author bambi
|
||||
*/
|
||||
class CoreWiederholerTagLib
|
||||
{
|
||||
protected $ci;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->ci = get_instance();
|
||||
$this->ci->load->model('crm/Prestudentstatus_model', 'PrestudentstatusModel');
|
||||
}
|
||||
|
||||
public function getZuordnungIds(array $params)
|
||||
{
|
||||
if(!isset($params['studiensemester_kurzbz']))
|
||||
{
|
||||
return (object) array(
|
||||
'prestudent_id' => []
|
||||
);
|
||||
}
|
||||
|
||||
$semester = $params['studiensemester_kurzbz'];
|
||||
$result = $this->ci->PrestudentstatusModel-> loadWhere(array(
|
||||
'statusgrund_id' => 16,
|
||||
'studiensemester_kurzbz' => $semester
|
||||
));
|
||||
$data = $result->retval;
|
||||
$ids = array_map(function($item) {
|
||||
return $item->prestudent_id;
|
||||
}, $data);
|
||||
|
||||
return (object) array(
|
||||
'prestudent_id' => $ids
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user