🌈 搜索
📅  最后修改于: 2022-03-11 14:54:07.780000             🧑  作者: Mango
$query = Folder::find()->joinWith(['documents'])->orderBy(['COUNT(documents.id)' => SORT_ASC])->groupBy('folder.id');