mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-28 16:24:54 +02:00
#12168 Fixed sql bringing main services
This commit is contained in:
parent
13ba9aff39
commit
04649dee00
@ -738,19 +738,15 @@ class TreeService extends Tree
|
||||
|
||||
$filterResult = db_get_all_rows_sql($sqlFilter);
|
||||
|
||||
$services = [];
|
||||
foreach ($filterResult as $key => $result) {
|
||||
$ancestors = services_get_services_ancestors($result['id']);
|
||||
$idAncestors = implode(',', $ancestors);
|
||||
$numAncestors = count($ancestors);
|
||||
if ($numAncestors > 1) {
|
||||
$whereAncestors = ' AND tse.id_service_child in ('.$idAncestors.')';
|
||||
} else if ($numAncestors == 1) {
|
||||
$whereAncestors = ' AND ts.id ='.$idAncestors;
|
||||
} else {
|
||||
$whereAncestors = ' AND ts.id ='.$result['id'];
|
||||
}
|
||||
$services_ancestors = services_get_services_ancestors($result['id']);
|
||||
$services[] = array_pop($services_ancestors);
|
||||
}
|
||||
|
||||
$services_list = array_unique($services, SORT_NUMERIC);
|
||||
$whereAncestors = ' AND tse.id_service IN ('.implode(',', $services_list).')';
|
||||
|
||||
return $whereAncestors;
|
||||
}
|
||||
|
||||
|
@ -1561,6 +1561,7 @@ var TreeController = {
|
||||
* Filter the tree based on a search criterion
|
||||
*/
|
||||
function _filterItems(rawTree, searched) {
|
||||
console.log(rawTree);
|
||||
const ancestors = [];
|
||||
const father = [];
|
||||
const newTree = [];
|
||||
|
Loading…
x
Reference in New Issue
Block a user