📅  最后修改于: 2022-03-11 14:53:50.130000             🧑  作者: Mango
$customer = FinanceSale::select(
DB::raw('SUM(sub_total) as total_sales'),
DB::raw('SUM(discount) as d'),
)
->where('customer_id', $id)
->groupBy('customer_id')
->first();