chg: [component:CRUD] Added comment to be fixed later on - WiP

pull/93/head
Sami Mokaddem 2021-11-24 09:12:39 +01:00
parent d136955160
commit 94c0b171a1
No known key found for this signature in database
GPG Key ID: 164C473F627A06FA
1 changed files with 4 additions and 0 deletions

View File

@ -1023,6 +1023,7 @@ class CRUDComponent extends Component
}
}
if (!empty($params['relatedFilters'])) {
// $query->group("{$this->TableAlias}.id");
foreach ($params['relatedFilters'] as $filter => $filterValue) {
$activeFilters[$filter] = $filterValue;
$filterParts = explode('.', $filter);
@ -1066,6 +1067,9 @@ class CRUDComponent extends Component
return $query->where([$modelAlias . '.id IN' => $subQuery]);
}
// FIXME: Adding related condition with association having `through` setup might include duplicate in the result set
// We should probably rely on `innerJoinWith` and perform deduplication via `distinct`
// Or grouping by primary key for the main model (however this is not optimal/efficient/clean)
protected function setNestedRelatedCondition($query, $filterParts, $filterValue)
{
$modelName = $filterParts[0];