\PHPWeek\Core\Models\Pushdata::query()->select(DB::raw('max(id)'))->groupBy('url','model','model_id')->get()
Laravel 实现Eloquent模型分组查询并返回每个分组的最大值 groupBy()
最新推荐文章于 2024-02-23 16:49:23 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)
\PHPWeek\Core\Models\Pushdata::query()->select(DB::raw('max(id)'))->groupBy('url','model','model_id')->get()