我的控制器看起来像这样:
$rekap= DB::table('skpds')
->join('usulans','skpds.idSkpd','=','usulans.idSkpd')
->join('usulanhonors','skpds.idSkpd','=', 'usulanhonors.idSkpd')
->groupBy('nama_skpd')
->get( array(
DB::raw( 'SUM(usulans.apbd) AS apbd' ),
DB::raw( 'min(usulanhonors.jumlah_usulan_gaji) AS jumlah_usulan_gaji' ),
DB::raw( 'sum(apbd + jumlah_usulan_gaji) AS semua' ),
'nama_skpd'
));
答案 0 :(得分:0)
你必须在两列之间传递乘号,如
DB::raw('sum(quantity*per_qty) AS total')