From faff282e9a185ab5dd59c0d8d4009bfe5ae9a1ba Mon Sep 17 00:00:00 2001 From: cody <648753004@qq.com> Date: Mon, 1 Jul 2024 13:13:18 +0800 Subject: [PATCH] update --- app/Http/Controllers/Admin/StatisticsController.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/Http/Controllers/Admin/StatisticsController.php b/app/Http/Controllers/Admin/StatisticsController.php index 1c32ae0..02c7f78 100755 --- a/app/Http/Controllers/Admin/StatisticsController.php +++ b/app/Http/Controllers/Admin/StatisticsController.php @@ -553,9 +553,10 @@ class StatisticsController extends CommonController foreach ($areaList as $item) { $beds = Bed::where('area_id', $item->id)->where('project_id', $project_id)->get(); // 订单总数 - $orderTotal = Orders::where('project_id', $project_id) + $orderTotal = OrderItems::where('project_id', $project_id) ->where('created_at', 'like', '%' . $month . '%') ->whereIn('bed_id', $beds->pluck('id')) + ->whereNotNull('paid_at') ->sum('total'); $item->order_total = $orderTotal; $item->shouxufei = round($orderTotal * 0.006, 2); @@ -589,7 +590,7 @@ class StatisticsController extends CommonController $zongji['zengshishui'] = $total['zengshishui'] * 2; $zongji['shijishouru'] = $total['shijishouru'] - $refund['shijishouru']; $zongji['guanlifei'] = $total['guanlifei'] - $refund['guanlifei']; - + $admin = Auth::guard("admin")->user(); return view($this->bladePath . ".income", compact("admin", "zongji", "refund", "total", "area", "project", "project_id", "month", "projects")); }