📜  按关系列排序 - 无论代码示例

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

代码示例1
return $this->channels()
                ->leftJoin('replies', 'channels.id', '=', 'replies.channel_id')
                ->groupBy(['channels.id'])
                ->orderByRaw('max(replies.created_at) desc')
                ->get();