Answer the question
In order to leave comments, you need to log in
What is the easiest way to get a random value in Yii2?
Let's say we have a request:
$model = Post::find()->andWhere(['fignya'=>'1'])->all();
Answer the question
In order to leave comments, you need to log in
ORDER BY RAND is a resource-intensive thing, I recommend that you familiarize yourself with MySQL optimization: ORDER BY RAND ()
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question