|
|
|
|
@ -245,7 +245,10 @@ class OrdersController extends CommonController
|
|
|
|
|
}])->orderBy("building.myindex")
|
|
|
|
|
->orderBy("area.myindex")
|
|
|
|
|
->select("area.id", "area.name", "area.building_id", "area.project_id")
|
|
|
|
|
->where('beds_count','>',0)
|
|
|
|
|
->addSelect([
|
|
|
|
|
'total' => Bed::whereColumn('area_id', 'area.id')->selectRaw('count(1) as beds_count'),
|
|
|
|
|
])
|
|
|
|
|
//->where('beds_count','>',0)
|
|
|
|
|
->leftJoin("building", "area.building_id", "=", "building.id")
|
|
|
|
|
->addSelect("building.name as building_name")
|
|
|
|
|
->withCount("beds")
|
|
|
|
|
|