Answer the question
In order to leave comments, you need to log in
How to select a user who is not equal to a given value in Yii 2?
Hello, how can I select a user whose id is not equal to the given parameter, for example, 1
to extract users, I do this
$provider = new ActiveDataProvider([
'query' => User::find()->where(['id' => 1]) // как можно сделать Неравен
]);
$searchModel = new UserSearch();
return $this->render('index', [
'searchModel' => $searchModel,
'dataProvider' => $provider,
]);
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question