|
|
|
|
@ -463,19 +463,21 @@ class StatisticsController extends CommonController
|
|
|
|
|
foreach ($area as $item) {
|
|
|
|
|
// 床位占比
|
|
|
|
|
$item->bed_rate = 0;
|
|
|
|
|
if($totalBed){
|
|
|
|
|
if ($totalBed) {
|
|
|
|
|
$item->bed_rate = round($item->beds_count / $totalBed, 2) * 100;
|
|
|
|
|
}
|
|
|
|
|
// 订单数
|
|
|
|
|
$item->order_total = Orders::where('project_id', $project_id)->whereIn('bed_id', $beds->pluck('id'))
|
|
|
|
|
$item->order_total = Orders::where('project_id', $project_id)
|
|
|
|
|
->where('created_at', 'like', '%' . $month . '%')
|
|
|
|
|
->whereIn('bed_id', $beds->pluck('id'))
|
|
|
|
|
->count();
|
|
|
|
|
$item->rate = 0;
|
|
|
|
|
if($totalBed){
|
|
|
|
|
if ($totalBed) {
|
|
|
|
|
// 配比
|
|
|
|
|
$item->rate = round($item->order_total / $totalBed, 2) * 100;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return view($this->bladePath . ".bed", compact("area", "project", "project_id","month","projects"));
|
|
|
|
|
return view($this->bladePath . ".bed", compact("area", "project", "project_id", "month", "projects"));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|