laravel sum 多个字段

laravel中怎么实现下面的SQLhtml

select sum('profit'),sum('order_count') from pro where......;laravel

 

参考code

self::where('id', $id)->first(
    array(
        \DB::raw('SUM(profit) as profit'),
        \DB::raw('SUM(order_count) as order_count')
    )
)->toArray();

 转载:https://www.cnblogs.com/xiaozong/p/5949623.html#undefinedhtm

相关文章
相关标签/搜索