|
|
|
|
@ -247,14 +247,10 @@ class OrdersController extends CommonController
|
|
|
|
|
->select("area.id", "area.name", "area.building_id", "area.project_id")
|
|
|
|
|
->leftJoin("building", "area.building_id", "=", "building.id")
|
|
|
|
|
->addSelect("building.name as building_name")
|
|
|
|
|
->withCount("beds")
|
|
|
|
|
->get();
|
|
|
|
|
if ($has_ongoing_order) {
|
|
|
|
|
$data = $data->filter(function ($item) {
|
|
|
|
|
return $item->beds->count();
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
dd($data->count());
|
|
|
|
|
->addSelect([
|
|
|
|
|
'beds_count' => Bed::whereColumn('area_id', 'area.id')->selectRaw('count(1)'),
|
|
|
|
|
])->having('beds_count', '>', 0)
|
|
|
|
|
->paginate(10);
|
|
|
|
|
$projects = (new StatisticsController())->_checkProjects();
|
|
|
|
|
return view($this->bladePath . ".artboard", compact("data", "projects", "project_id"));
|
|
|
|
|
|
|
|
|
|
|