mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-24 02:12:17 +00:00
Merge branch 'master' into feature-25999/C4
This commit is contained in:
@@ -22,13 +22,23 @@ class Issue_model extends DB_Model
|
||||
*/
|
||||
public function getOpenIssues($fehlercodes, $person_id = null, $oe_kurzbz = null, $fehlercode_extern = null)
|
||||
{
|
||||
$params = array($fehlercodes);
|
||||
$params = array();
|
||||
// issue exists for a fehlercode (or fehlercode_extern), person_id, oe_kurzbz, if not verarbeitet yet
|
||||
$qry = 'SELECT issue_id, fehlercode, inhalt, fehlercode_extern, inhalt_extern, person_id, oe_kurzbz,
|
||||
behebung_parameter, datum, verarbeitetvon, verarbeitetamum
|
||||
FROM system.tbl_issue
|
||||
WHERE fehlercode IN ?
|
||||
AND verarbeitetamum IS NULL';
|
||||
$qry = 'SELECT
|
||||
iss.issue_id, iss.fehlercode, fe.fehler_kurzbz, iss.inhalt, iss.fehlercode_extern,
|
||||
iss.inhalt_extern, iss.person_id, iss.oe_kurzbz, iss.behebung_parameter,
|
||||
iss.datum, iss.verarbeitetvon, iss.verarbeitetamum
|
||||
FROM
|
||||
system.tbl_issue iss
|
||||
JOIN system.tbl_fehler fe USING (fehlercode)
|
||||
WHERE
|
||||
verarbeitetamum IS NULL';
|
||||
|
||||
if (!isEmptyArray($fehlercodes))
|
||||
{
|
||||
$qry .= ' AND fehlercode IN ?';
|
||||
$params[] = $fehlercodes;
|
||||
}
|
||||
|
||||
if (!isEmptyString($fehlercode_extern))
|
||||
{
|
||||
@@ -59,7 +69,7 @@ class Issue_model extends DB_Model
|
||||
* @param string $fehlercode_extern if provided, only issues with this external fehlercode are counted (for identifying issues from external systems).
|
||||
* @return Object success with number of issues or error
|
||||
*/
|
||||
public function getOpenIssueCount($fehlercode, $person_id = null, $oe_kurzbz = null, $fehlercode_extern = null)
|
||||
public function getOpenIssueCount($fehlercode, $person_id = null, $oe_kurzbz = null, $fehlercode_extern = null, $behebung_parameter = null)
|
||||
{
|
||||
$params = array($fehlercode);
|
||||
// issue exists for a fehlercode (or fehlercode_extern), person_id, oe_kurzbz, if not verarbeitet yet
|
||||
@@ -85,6 +95,19 @@ class Issue_model extends DB_Model
|
||||
$params[] = $oe_kurzbz;
|
||||
}
|
||||
|
||||
if (isset($behebung_parameter) && !isEmptyArray($behebung_parameter))
|
||||
{
|
||||
// convert array to JSON string for postgres
|
||||
$behebung_parameter_string = json_encode($behebung_parameter);
|
||||
|
||||
if ($behebung_parameter_string)
|
||||
{
|
||||
// check if jsonb value is equal to the passed parameters array (if value contains array and array contains value)
|
||||
$qry .= ' AND behebung_parameter @> ? AND behebung_parameter <@ ?';
|
||||
$params = array_merge($params, array($behebung_parameter_string, $behebung_parameter_string));
|
||||
}
|
||||
}
|
||||
|
||||
return $this->execQuery($qry, $params);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -327,7 +327,7 @@ class Recipient_model extends DB_Model
|
||||
pr.nachname,
|
||||
ms.person_id,
|
||||
mrou.token
|
||||
ORDER BY sent DESC';
|
||||
ORDER BY sent DESC LIMIT 1500';
|
||||
|
||||
return $this->execQuery($sql, array($person_id, $functions, $person_id));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user