From 13914acfa6058fe8946964b981d951ce6dcc2aaa Mon Sep 17 00:00:00 2001 From: cody <648753004@qq.com> Date: Fri, 14 Jun 2024 14:11:45 +0800 Subject: [PATCH] 1 --- app/Http/Controllers/Admin/StatisticsController.php | 9 +++++---- resources/views/admin/statistics/finance.blade.php | 4 ++++ 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/app/Http/Controllers/Admin/StatisticsController.php b/app/Http/Controllers/Admin/StatisticsController.php index f648f51..5509319 100755 --- a/app/Http/Controllers/Admin/StatisticsController.php +++ b/app/Http/Controllers/Admin/StatisticsController.php @@ -266,6 +266,7 @@ class StatisticsController extends CommonController $query->where("project_id", $project_id); }) ->get(); + $recharges_sum = $recharges->sum('money'); $refunds = Refund::whereNotNull("paid_at") ->where(function ($query) use ($hushizhang, $orderIds) { @@ -278,8 +279,8 @@ class StatisticsController extends CommonController $query->where("project_id", $project_id); }) ->get(); - - return view($this->bladePath . ".finance", compact("recharges", "refunds", "projects", "project_id", "months", "month")); + $refunds_sum = $refunds->sum('money'); + return view($this->bladePath . ".finance", compact("recharges_sum", "refunds_sum", "recharges", "refunds", "projects", "project_id", "months", "month")); } public function memberBalanceByDate(Request $request) @@ -419,12 +420,12 @@ class StatisticsController extends CommonController } // 获取所有列 $lie = []; - if(isset($data[0]->lies)){ + if (isset($data[0]->lies)) { $lie = array_column($data[0]->lies, 'name'); } $months = $this->_getMonths(); - return view($this->bladePath . ".huli", compact("sumOrderTotal","data", "month", "lie", "projects", "project_id")); + return view($this->bladePath . ".huli", compact("sumOrderTotal", "data", "month", "lie", "projects", "project_id")); } /** diff --git a/resources/views/admin/statistics/finance.blade.php b/resources/views/admin/statistics/finance.blade.php index 9f62fdd..10ca636 100755 --- a/resources/views/admin/statistics/finance.blade.php +++ b/resources/views/admin/statistics/finance.blade.php @@ -82,6 +82,10 @@ {{ $item->refunds_count ? $item->refunds_count : "" }} @endforeach + + 合计 + {{$recharges_sum}} +
退款明细