是否像sql一样在laravel中有一个函数last()?我不想使用orderby('price','desc')->first()
这是我当前的查询
$this->businessfund->whereBusiness_id($id)->whereCategory('Investment')
->select(\DB::raw('DATE(created_at) as date, count(*) as total_trade, last(price), min(price) as min, max(price) as max, sum(shares) as volume, sum(total_price) as total_price'))
->groupBy('date')
->get();
如何按日期插入第一个和最后一个数据?