我试图实现减去不同表中的两个整数值,这是我到目前为止所尝试的。Controller:$amount = DB::table('shipping_datas')->where('amount')->first();$payment = DB::table('payments')->where('amount')->first();$balance = $amount - $payment;Blade:{{ $balance }}先感谢您 :)
1 回答
慕码人2483693
TA贡献1860条经验 获得超9个赞
$amount = DB::table('shipping_datas')->pluck('amount')->sum();
$payment = DB::table('payments')->pluck('amount')->sum();
$balance = $amount - $payment;
我认为它的工作。
- 1 回答
- 0 关注
- 62 浏览
添加回答
举报
0/150
提交
取消