liyinglin 2 years ago
parent d5580f2f61
commit 9370340e13

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

Loading…
Cancel
Save