mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-23 18:02:18 +00:00
Letzte Änderung
This commit is contained in:
@@ -61,6 +61,8 @@ class Notiz extends FHC_Controller
|
||||
$this->load->model('person/Notiz_model', 'NotizModel');
|
||||
$this->NotizModel->addJoin('public.tbl_notiz_dokument', 'notiz_id', 'LEFT');
|
||||
$this->NotizModel->addSelect('*');
|
||||
$this->NotizModel->addSelect("TO_CHAR(CASE WHEN public.tbl_notiz.updateamum >= public.tbl_notiz.insertamum
|
||||
THEN public.tbl_notiz.updateamum ELSE public.tbl_notiz.insertamum END::timestamp, 'DD.MM.YYYY HH24:MI:SS') AS lastUpdate");
|
||||
$this->NotizModel->addLimit(1);
|
||||
|
||||
$result = $this->NotizModel->loadWhere(
|
||||
|
||||
@@ -266,9 +266,27 @@ class Notiz_model extends DB_Model
|
||||
*/
|
||||
public function getNotizWithDocEntries($id, $type)
|
||||
{
|
||||
// ci query builder returns null
|
||||
/* $this->db->select('n.*, count(dms_id) as countDoc, z.notizzuordnung_id');
|
||||
$this->db->select('(CASE WHEN n.updateamum >= n.insertamum THEN n.updateamum ELSE n.insertamum END) AS lastUpdate');
|
||||
$this->db->from('public.tbl_notiz n');
|
||||
$this->db->join('public.tbl_notizzuordnung z', 'n.notiz_id = z.notiz_id');
|
||||
$this->db->join('public.tbl_notiz_dokument dok', 'n.notiz_id = dok.notiz_id', 'left');
|
||||
$this->db->join('campus.tbl_dms_version', 'dok.notiz_id = campus.tbl_dms_version.dms_id', 'left');
|
||||
$this->db->where("z.$type", $id);
|
||||
$this->db->group_by('n.notiz_id, z.notizzuordnung_id');
|
||||
|
||||
$query = $this->db->get();
|
||||
return $query->result();*/
|
||||
|
||||
|
||||
$qry = "
|
||||
SELECT
|
||||
n.*, count(dms_id) as countDoc, z.notizzuordnung_id
|
||||
n.*, count(dms_id) as countDoc, z.notizzuordnung_id,
|
||||
TO_CHAR (CASE
|
||||
WHEN n.updateamum >= n.insertamum THEN n.updateamum
|
||||
ELSE n.insertamum
|
||||
END::timestamp, 'DD.MM.YYYY HH24:MI:SS') AS lastUpdate
|
||||
FROM
|
||||
public.tbl_notiz n
|
||||
JOIN
|
||||
@@ -284,6 +302,7 @@ class Notiz_model extends DB_Model
|
||||
";
|
||||
|
||||
return $this->execQuery($qry, array($id));
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user