Closed hrach closed 4 weeks ago
@stepapo Thanks for the thorough testing, fix in #687
I really wish to tell you everything is ok :-D But this does not work in postgres: column "author.name" must appear in the GROUP BY. Not sure about creating new issue as it might be connected to this one, so just posting it here.
$this->model->books->findBy([
ICollection::OR,
['author->name' => 'Writer 1'],
[CompareGreaterThanFunction::class, [CountAggregateFunction::class, 'tags->id'], 0],
]);
@stepapo fixed, added more tests 🙏 🤞
Found one more, hopefully not a big deal. Just like the first one, AND and OR produce identical query, only correct for AND.
$this->model->books->findBy([
ICollection::OR,
['title' => 'Book 1'],
[ICollection::AND, new NoneAggregator, 'tags->id' => 3],
]);
$this->model->books->findBy([
ICollection::AND,
['title' => 'Book 1'],
[ICollection::AND, new NoneAggregator, 'tags->id' => 3],
]);
Originally posted by @stepapo in https://github.com/nextras/orm/issues/685#issuecomment-2446199417