Reputation: 430
I am modifying this query to Yii2 ActiveRecord
.
$query = "SELECT min(sorting_value) as sorting_value FROM table WHERE sorting_value>'$variable'"
As far I have done this:
$queryValue = Mymodel::find()->min('sorting_value')->where(['sorting_value' > $sort1]);
And it is showing this error:
Call to a member function where() on a non-object
How can I solve this issue. I can't use where condition with min()
function.
Upvotes: 1
Views: 5514