Answers for "sort relation model count yii2"

PHP
0

sort relation model count yii2

$query = Folder::find()->joinWith(['documents'])->orderBy(['COUNT(documents.id)' => SORT_ASC])->groupBy('folder.id');
Posted by: Guest on April-27-2021

Browse Popular Code Answers by Language