master
cody 2 years ago
parent 2b8716b506
commit 063cdf17e6

@ -584,11 +584,11 @@ class StatisticsController extends CommonController
// ->where('created_at', 'like', '%' . $month . '%')
// ->whereIn('bed_id', $beds->pluck('id'))
// ->get();
$refund['order_total'] = Balance::where('created_at', 'like', '%' . $month . '%')
$refund['order_total'] = abs(Balance::where('created_at', 'like', '%' . $month . '%')
->where('belongs_type', 'App\Models\Refund')
->whereHas("order", function ($query) use ($project_id) {
$query->where("project_id", $project_id);
})->sum("money");
})->sum("money"));
$refund['shijishouru'] = $refund['order_total'];
$refund['guanlifei'] = round($refund['order_total'] * 0.06, 2);
// 总计

Loading…
Cancel
Save