Answer the question
In order to leave comments, you need to log in
Yii How to correctly form criteria For the HAS_MANY connection?
0
vote against
favorites
Good afternoon. There is a POST model. And there is a model category_r In the last 3 columns: id, Post_id, category_id.
I need to make a selection of posts where category_id is equal to 1 and 2 for example. HERE are my criteria:
$criteria->condition = 'category.category_id=2 AND category.category_id=1';
$criteria->together = true;
Then returns an empty model. With one condition, for examplecriteria->condition = 'category.category_id=2' - тут все отлично.
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question