Reputation: 638
The following query returns all records, but they are not in descending order. It seems the query is unaffected by the second parameter of orderBy.
\app\models\Lookup::find()->orderBy('id',SORT_DESC)->all()
Upvotes: 1
Views: 35
Reputation: 121
You can either do the orderBy like a single string parameter:
\app\models\Lookup::find()->orderBy('id SORT_DESC')->all()
or as an array with key => value:
\app\models\Lookup::find()->orderBy(['id'=>SORT_DESC])->all()
Upvotes: 2