Yii Relational record with condition from other table
问题 I have a relational record similar to the following: There are users (table users) with ids There are categories (table categories) with id, name There are articles (table articles) with id, body, category_id Then there is a table read_articles with article_id, user_id So a user can see a list of all articles in a category. They can click on an article and it will add an entry (user_id, article_id) to the read_articles table. I want to be able to use Yii's ActiveRecord to get all articles