|
|
|
|
@ -88,20 +88,30 @@ class OrdersController extends CommonController
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$data = $this->model
|
|
|
|
|
->with([
|
|
|
|
|
"orderItems",
|
|
|
|
|
"firstItem",
|
|
|
|
|
"lastItem",
|
|
|
|
|
"project",
|
|
|
|
|
"product",
|
|
|
|
|
"customer",
|
|
|
|
|
"manager",
|
|
|
|
|
"bed" => function ($query) {
|
|
|
|
|
$query->with(["room", "building", "area"]);
|
|
|
|
|
$data = $this->model->with([
|
|
|
|
|
"orderItems",
|
|
|
|
|
"firstItem",
|
|
|
|
|
"lastItem",
|
|
|
|
|
"project",
|
|
|
|
|
"product",
|
|
|
|
|
"customer",
|
|
|
|
|
"manager",
|
|
|
|
|
"bed" => function ($query) {
|
|
|
|
|
$query->with(["room", "building", "area"]);
|
|
|
|
|
}
|
|
|
|
|
])->where('status', $status)
|
|
|
|
|
->where(function ($query) use ($building_id, $area_id) {
|
|
|
|
|
if ($building_id || $area_id) {
|
|
|
|
|
$query->whereHas('bed', function ($q) use ($building_id, $area_id) {
|
|
|
|
|
if (isset($building_id)) {
|
|
|
|
|
$q->where('building_id', $building_id);
|
|
|
|
|
}
|
|
|
|
|
if (isset($area_id)) {
|
|
|
|
|
$q->where('area_id', $area_id);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
])->where('status', $status)
|
|
|
|
|
->orderBy("id", "desc");
|
|
|
|
|
})->orderBy("id", "desc");
|
|
|
|
|
|
|
|
|
|
if (request()->is_export) {
|
|
|
|
|
$data = $data->get();
|
|
|
|
|
@ -126,7 +136,7 @@ class OrdersController extends CommonController
|
|
|
|
|
'20' => '进行中',
|
|
|
|
|
'100' => '已完成'
|
|
|
|
|
];
|
|
|
|
|
return view($this->bladePath . ".index", compact('area_id','building_id','buildings', 'areas', "status", "data", "project_id", "month", "project", "hushizhang", "yuanfang", "order_status_list"));
|
|
|
|
|
return view($this->bladePath . ".index", compact('area_id', 'building_id', 'buildings', 'areas', "status", "data", "project_id", "month", "project", "hushizhang", "yuanfang", "order_status_list"));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function _getMonths()
|
|
|
|
|
|