|
|
|
|
@ -384,7 +384,6 @@ class StatisticsController extends CommonController
|
|
|
|
|
$projects = (new StatisticsController())->_checkProjects();
|
|
|
|
|
$defaultProjectsId = ($projects[0]->id) ?? '';
|
|
|
|
|
$project_id = $request->get('project_id', $defaultProjectsId);
|
|
|
|
|
dump($project_id);
|
|
|
|
|
|
|
|
|
|
$userId = auth()->id();
|
|
|
|
|
// 判断是否护士长
|
|
|
|
|
@ -413,8 +412,8 @@ class StatisticsController extends CommonController
|
|
|
|
|
|
|
|
|
|
foreach ($data as $item) {
|
|
|
|
|
// 获取所有床位id
|
|
|
|
|
$bedIds = Bed::where('area_id', $item->id)->pluck('id');
|
|
|
|
|
$order = Orders::whereIn('bed_id', $bedIds)->where('status', 100)->get();
|
|
|
|
|
$bedIds = Bed::where('project_id', $project_id)->where('area_id', $item->id)->pluck('id');
|
|
|
|
|
$order = Orders::where('project_id', $project_id)->whereIn('bed_id', $bedIds)->where('status', 100)->get();
|
|
|
|
|
$item->order_total = $order->sum('total');
|
|
|
|
|
$item->lies = $this->getLies($bedIds, $productItem, $factor);
|
|
|
|
|
}
|
|
|
|
|
|