 <p>In this case could be better a CreateCommand </p> <p>for do this you should bild raw query using join eg: </p> <pre><code>select * from `feed` join `website` on `website`.id = `feed`.`website_id` WHERE website`.`user_id`= 1 AND `feed`.id IN (2, 3) </code></pre> <p>or for delete </p> <pre><code>delete from `feed` join `website` on `website`.id = `feed`.`website_id` WHERE website`.`user_id`= 1 AND `feed`.id IN (2, 3) </code></pre> <p>then for Yii2</p> <pre><code>$sql = "delete from `feed` join `website` on `website`.id = `feed`.`website_id` WHERE website`.`user_id`= 1 AND `feed`.id IN (2, 3);" Yii::$app-&gt;db-&gt;createCommand($sql)-&gt;execute(); </code></pre>