chg: [component:CRUD] Added comment to be fixed later on - WiP
parent
d136955160
commit
94c0b171a1
|
@ -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];
|
||||
|
|
Loading…
Reference in New Issue