Yii2: How to add two fields in orderby() of Find()
According to the documentation:
$model::find()->orderBy([
'id_date' => SORT_DESC,
'item_no'=>SORT_ASC
]);
You have a syntax error in the following code:
$model::find()->orderBy([['id_date' => SORT_DESC], ['item_no' => SORT_ASC]);
The correct way of doing this is:
$model::find()->orderBy(['id_date' => SORT_DESC, 'item_no' => SORT_ASC]);