|
|
|
|
@ -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")
|
|
|
|
|
|