Skip to content
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] Criteria doesn't see joins #1327

Closed
ZoRDoK opened this issue Oct 3, 2013 · 2 comments
Closed

[BUG] Criteria doesn't see joins #1327

ZoRDoK opened this issue Oct 3, 2013 · 2 comments

Comments

@ZoRDoK
Copy link

ZoRDoK commented Oct 3, 2013

Sorry for my english

In this code:

$qb = static::query()
->columns('Model\Sale.*, game.*, user.*')
->innerJoin('Model\Game', 'game.id = Model\Sale.game_id', 'game')
->innerJoin('Model\User', 'user.id = Model\Sale.user_id', 'user');

if ($activeOnly) $qb->andWhere('Model\Sale.is_active = true');

return $qb->execute();

I get:

Unknown model or alias 'game' (2), when preparing: SELECT Model\Sale.*, game.*, user.* FROM [Model\Sale] WHERE Model\Sale.is_active = true
@ghost
Copy link

ghost commented Oct 3, 2013

Phalcon 1.3.0 or 1.2.3/1.2.4?

@ZoRDoK
Copy link
Author

ZoRDoK commented Oct 3, 2013

1.2.3 (master)

@ghost ghost mentioned this issue Oct 3, 2013
phalcon pushed a commit that referenced this issue Oct 4, 2013
@niden niden closed this as completed in e2abf39 Oct 9, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant