From 68d8912aaf553313794ce38b4b505bec6107d2c1 Mon Sep 17 00:00:00 2001 From: liyinglin Date: Wed, 3 Jan 2024 13:49:31 +0800 Subject: [PATCH] 1 --- app/Http/Controllers/Admin/OrdersController.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/Http/Controllers/Admin/OrdersController.php b/app/Http/Controllers/Admin/OrdersController.php index 9d2bc76..5a6d377 100755 --- a/app/Http/Controllers/Admin/OrdersController.php +++ b/app/Http/Controllers/Admin/OrdersController.php @@ -244,11 +244,11 @@ class OrdersController extends CommonController ->orderBy("bed.name"); }])->orderBy("building.myindex") ->orderBy("area.myindex") - ->select("area1.id", "area.name", "area.building_id", "area.project_id") + ->select("area.id", "area.name", "area.building_id", "area.project_id") ->addSelect([ 'beds_count' => Bed::whereColumn('area_id', 'area.id')->selectRaw('count(1)'), ]) - ->whereRaw('beds_count > 0') + ->having('beds_count', '>', 0) ->leftJoin("building", "area.building_id", "=", "building.id") ->addSelect("building.name as building_name") // ->withCount("beds")