From 063cdf17e6167a85b8dc72e9623d9a40703e9996 Mon Sep 17 00:00:00 2001 From: cody <648753004@qq.com> Date: Mon, 1 Jul 2024 14:08:52 +0800 Subject: [PATCH] update --- app/Http/Controllers/Admin/StatisticsController.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/Http/Controllers/Admin/StatisticsController.php b/app/Http/Controllers/Admin/StatisticsController.php index e79e644..7fa8dd8 100755 --- a/app/Http/Controllers/Admin/StatisticsController.php +++ b/app/Http/Controllers/Admin/StatisticsController.php @@ -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); // 总计