📅  最后修改于: 2022-03-11 14:53:48.180000             🧑  作者: Mango
$purchases = DB::table('transactions')
->join('categories', 'transactions.category_id', '=', 'categories.id')
->where('categories.kind', '=', 1)
->sum('transactions.amount');