mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-24 02:12:17 +00:00
Issue system: adapted to work with multiple apps per fehler
This commit is contained in:
@@ -12,4 +12,41 @@ class Fehler_model extends DB_Model
|
||||
$this->pk = array('fehlercode');
|
||||
$this->hasSequence = false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets all fehler for particular apps.
|
||||
* @param $apps string of one app or array with multiple
|
||||
* @return object success or error
|
||||
*/
|
||||
public function getByApps($apps)
|
||||
{
|
||||
if (is_string($apps)) $apps = [$apps];
|
||||
|
||||
$params = [];
|
||||
|
||||
$qry = "
|
||||
SELECT
|
||||
fehlercode, fehler_kurzbz, fehlercode_extern, fehlertext, fehlertyp_kurzbz
|
||||
FROM
|
||||
system.tbl_fehler fe";
|
||||
|
||||
if (!isEmptyArray($apps))
|
||||
{
|
||||
$qry .= "
|
||||
WHERE EXISTS (
|
||||
SELECT 1
|
||||
FROM
|
||||
system.tbl_fehler_app
|
||||
WHERE
|
||||
fehlercode = fe.fehlercode
|
||||
AND app IN ?
|
||||
)";
|
||||
|
||||
$params[] = $apps;
|
||||
}
|
||||
|
||||
$qry .= " ORDER BY fehlercode;";
|
||||
|
||||
return $this->execReadOnlyQuery($qry, $params);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user