laravel last()函数类似于sql

时间:2016-07-10 14:18:20

标签: laravel

是否像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();

如何按日期插入第一个和最后一个数据?

0 个答案:

没有答案