mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-24 02:12:17 +00:00
use renderers in search config
This commit is contained in:
@@ -225,6 +225,7 @@ $config['studentcis']['resultfields'] = [
|
||||
AS photo_url",
|
||||
"b.aktiv"
|
||||
];
|
||||
$config['studentcis']['renderer'] = 'student';
|
||||
|
||||
$config['prestudent'] = [
|
||||
'primarykey' => 'prestudent_id',
|
||||
@@ -538,6 +539,7 @@ $config['unassigned_employee']['searchfields']['tel']['join']['on'] = "
|
||||
kontakttyp = 'telefon'
|
||||
AND tbl_kontakt.standort_id = unassigned_employee.standort_id
|
||||
";
|
||||
$config['unassigned_employee']['renderer'] = 'employee';
|
||||
|
||||
$config['organisationunit'] = [
|
||||
'alias' => ['ou', 'organisationseinheit', 'oe'],
|
||||
@@ -674,6 +676,7 @@ $config['active_organisationunit'] = $config['organisationunit'];
|
||||
$config['active_organisationunit']['alias'] = ['aou', 'aktive organisationseinheit', 'aoe'];
|
||||
$config['active_organisationunit']['prepare'] = 'active_organisationseinheit AS (SELECT * FROM public.tbl_organisationseinheit WHERE aktiv = true)';
|
||||
$config['active_organisationunit']['table'] = 'active_organisationseinheit';
|
||||
$config['active_organisationunit']['renderer'] = 'organisationunit';
|
||||
|
||||
$config['room'] = [
|
||||
'alias' => ['raum'],
|
||||
|
||||
@@ -231,8 +231,10 @@ class SearchLib
|
||||
GROUP BY " . $this->_formatPrimarykeys($table_config['primarykey']) . "
|
||||
)";
|
||||
|
||||
$renderer = $table_config['renderer'] ?? $type;
|
||||
$selects[] = "
|
||||
SELECT
|
||||
" . $this->_ci->db->escape($renderer) . " AS renderer,
|
||||
" . $this->_ci->db->escape($type) . " AS type,
|
||||
rank,
|
||||
TO_JSONB((SELECT x FROM (SELECT " . implode(", ", $table_config['resultfields'] ?? ['*']) . ") x)) AS data
|
||||
|
||||
Reference in New Issue
Block a user