Answer the question
In order to leave comments, you need to log in
How to set a condition from and to in Yii2?
There is a price field,
there are two fields in the search, price from and to, how do I set a condition to select records in a given interval?
Answer the question
In order to leave comments, you need to log in
$prosucts = Product::find()->andWhere(['>','price',15])->andWhere(['<','price',100])->all();
$query->andFilterWhere(['>','price',$this->min])->andFilterWhere(['<','price',$this->max]);
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question