I have got mysql query, how I can take this data with yii2 activeRecord objects?
SELECT *
FROM `sel_posts`
WHERE `login_id` = 22 OR 23 OR 24 ... (this ids from array $ifollow)
ORDER BY `datetime` DESC
LIMIT 0 , 20
How I can do that?
I have got mysql query, how I can take this data with yii2 activeRecord objects?
SELECT *
FROM `sel_posts`
WHERE `login_id` = 22 OR 23 OR 24 ... (this ids from array $ifollow)
ORDER BY `datetime` DESC
LIMIT 0 , 20
How I can do that?
Classname::find()->limit(20)->where([‘in’,‘login_id’, $ifollow])->orderBy([‘datetime’ => SORT_DESC])->all()