From 3e6fa935c84652205eb813c874db4605779b2903 Mon Sep 17 00:00:00 2001 From: cody <648753004@qq.com> Date: Thu, 27 Jun 2024 16:32:16 +0800 Subject: [PATCH] update --- app/Http/Controllers/Admin/StatisticsController.php | 10 ++++++++-- resources/views/admin/statistics/income.blade.php | 8 ++++++++ 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/app/Http/Controllers/Admin/StatisticsController.php b/app/Http/Controllers/Admin/StatisticsController.php index a18084d..8340da4 100755 --- a/app/Http/Controllers/Admin/StatisticsController.php +++ b/app/Http/Controllers/Admin/StatisticsController.php @@ -546,6 +546,7 @@ class StatisticsController extends CommonController // 当月天数 $days = date('t', strtotime($month)); $area = Area::withCount('beds')->where('project_id', $project_id)->get(); + // 合计 $total['order_total'] = $total['shouxufei'] = $total['zengshishui'] = $total['shijishouru'] = $total['guanlifei'] = 0; foreach ($area as $item) { $beds = Bed::where('area_id', $item->id)->where('project_id', $project_id)->get(); @@ -577,7 +578,12 @@ class StatisticsController extends CommonController $refund['order_total'] = Refund::where('created_at', 'like', '%' . $month . '%')->whereIn('order_id', $allOrderTotal->pluck('id'))->sum('money'); $refund['shijishouru'] = $refund['order_total']; $refund['guanlifei'] = round($refund['order_total'] * 0.06, 2); - + // 总计 + $zongji['order_total'] = $total['order_total'] - $refund['order_total']; + $zongji['shouxufei'] = + $zongji['zengshishui'] = + $zongji['shijishouru'] = $total['shijishouru'] - $refund['shijishouru']; + $zongji['guanlifei'] = $total['guanlifei'] - $refund['guanlifei']; // 导出 if ($is_export) { @@ -606,7 +612,7 @@ class StatisticsController extends CommonController $writer->save('php://output'); exit; } - return view($this->bladePath . ".income", compact("refund","total", "area", "project", "project_id", "month", "projects")); + return view($this->bladePath . ".income", compact("zongji","refund", "total", "area", "project", "project_id", "month", "projects")); } } diff --git a/resources/views/admin/statistics/income.blade.php b/resources/views/admin/statistics/income.blade.php index 705377a..c7d0d36 100755 --- a/resources/views/admin/statistics/income.blade.php +++ b/resources/views/admin/statistics/income.blade.php @@ -65,6 +65,14 @@