Skip to content
Snippets Groups Projects
Verified Commit d4df9ae9 authored by Damien's avatar Damien
Browse files

FEAT #8956 Entities children fix

parent ea8de087
No related branches found
No related tags found
No related merge requests found
...@@ -313,12 +313,16 @@ class ResourceListController ...@@ -313,12 +313,16 @@ class ResourceListController
$entitiesChildren = []; $entitiesChildren = [];
foreach ($entities as $entity) { foreach ($entities as $entity) {
$children = EntityModel::getEntityChildren(['entityId' => $entity['entityId']]); if (!empty($entity['entityId'])) {
$count = 0; $children = EntityModel::getEntityChildren(['entityId' => $entity['entityId']]);
foreach ($entities as $value) { $count = 0;
if (in_array($value['entityId'], $children)) { foreach ($entities as $value) {
$count += $value['count']; if (in_array($value['entityId'], $children)) {
$count += $value['count'];
}
} }
} else {
$count = $entity['count'];
} }
$entitiesChildren[] = [ $entitiesChildren[] = [
'entityId' => $entity['entityId'], 'entityId' => $entity['entityId'],
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment