|
|
|
|
@ -462,12 +462,18 @@ class StatisticsController extends CommonController
|
|
|
|
|
$totalBed = $beds->count();
|
|
|
|
|
foreach ($area as $item) {
|
|
|
|
|
// 床位占比
|
|
|
|
|
$item->bed_rate = round($item->beds_count / $totalBed, 2) * 100;
|
|
|
|
|
$item->bed_rate = 0;
|
|
|
|
|
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'))
|
|
|
|
|
->count();
|
|
|
|
|
// 配比
|
|
|
|
|
$item->rate = round($item->order_total / $totalBed, 2) * 100;
|
|
|
|
|
$item->rate = 0;
|
|
|
|
|
if($totalBed){
|
|
|
|
|
// 配比
|
|
|
|
|
$item->rate = round($item->order_total / $totalBed, 2) * 100;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return view($this->bladePath . ".bed", compact("area", "project", "month"));
|
|
|
|
|
}
|
|
|
|
|
|