Orm::withCount(['relation as relation_sum' =>function($query){
    $query->select(DB::raw("sum(amount) as relationsum"));
}])

 

posted on 2021-11-03 10:25  jzfan  阅读(447)  评论(0编辑  收藏  举报