liyinglin 2 years ago
parent 9bf933fc1b
commit 463a5f9d87

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

Loading…
Cancel
Save