У меня есть такой запрос WHERE.
where
(posts.id in (
select posts.id from posts
where posts.carId in (
select car_subscription.carId from car_subscription
where car_subscription.userId = 37
)
)
or
posts.id in (
select posts.id from posts
where posts.userId in (
select user_subscription.userSubId from user_subscription
where user_subscription.userId = 37
)
) )
Как построить такой запрос с помощью yii2?. Как в where in вставить SELECT
$query->where(['in', 'posts.id', ''])
->orWhere(['in', 'posts.id', '']);