📜  排序关系模型计数 yii2 - PHP 代码示例

📅  最后修改于: 2022-03-11 14:54:07.780000             🧑  作者: Mango

代码示例1
$query = Folder::find()->joinWith(['documents'])->orderBy(['COUNT(documents.id)' => SORT_ASC])->groupBy('folder.id');