-
-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] В QueryBuilder не работает DISTINCT #2250
Comments
Fix #2250 Updated Phalcon\Db\Dialect::select
Could you try again compiling from the 1.3.2 branch? |
Thank you, in 1.3.2 branch DISTINCT it works. $phql = 'SELECT DISTINCT [Pin\Model\PinsTags].* FROM [Pin\Model\PinsTags]'; |
Nice work guys! I was waiting for the resolution of this problem 👍 |
$this->modelsManager->createBuilder()
->distinct(true)
->columns([ 'pt.*'])
->addFrom('Pin\Model\PinsTags', 'pt')
->getQuery()
->execute();
SQL Statement: SELECT
pins_tags
.id
,pins_tags
.pin_id
,pins_tags
.tag_id
FROMpins_tags
$phql = 'SELECT DISTINCT [Pin\Model\PinsTags].* FROM [Pin\Model\PinsTags]';
$this->modelsManager->executeQuery($phql);
SQL Statement: SELECT
pins_tags
.id
,pins_tags
.pin_id
,pins_tags
.tag_id
FROMpins_tags
Судя по коду - https://github.com/phalcon/cphalcon/blob/master/ext/mvc/model/query/builder.c#L1525
если передавать true/false, то на выходе получим SELECT DISTINCT/SELECT ALL, но чтобы я туда не передавал, на выходе только SELECT.
The text was updated successfully, but these errors were encountered: