- Fixed the JOIN comparison (instead of putting it in the main query)
This commit is contained in:
parent
b20e537038
commit
902167c2ed
|
@ -611,6 +611,7 @@ class Repository
|
|||
$foreignKey = is_string($annotation->foreignKey) ? $entity::field($annotation->foreignKey, $alias) : $annotation->foreignKey;
|
||||
|
||||
$this->join("LEFT", $entity::resolveEntity()->tableName(), $key, $foreignKey, $alias, function($join) use ($item, $entity, $alias) {
|
||||
|
||||
foreach($this->entityResolver->searchFieldAnnotationList($item, new Where() ) as $condition) {
|
||||
if ( ! is_object($condition->field) ) {
|
||||
$field = $this->entityClass::field($condition->field);
|
||||
|
@ -619,14 +620,12 @@ class Repository
|
|||
$field = clone $condition->field;
|
||||
}
|
||||
|
||||
/* @TODO FIX THIS !
|
||||
*
|
||||
* if ( $condition->field->entityClass === $entity ) {
|
||||
if ( $this->entityClass === $entity ) {
|
||||
# Adding directly
|
||||
if ( $field->entityClass === $entity ) {
|
||||
$field->alias = $alias;
|
||||
|
||||
$join->where(is_object($field) ? $field : $entity::field($field, $alias), $condition->value, $condition->operator);
|
||||
}*/
|
||||
}
|
||||
}
|
||||
|
||||
foreach($this->entityResolver->searchFieldAnnotationList($item, new FilterJoin() ) as $filter) {
|
||||
|
|
Loading…
Reference in New Issue