From d5e8a62510af0481ce053e1e8d6f3b8d033a3b73 Mon Sep 17 00:00:00 2001 From: brusnitsyn Date: Fri, 29 May 2026 10:53:05 +0900 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=20=D0=BE=D0=B1=D1=89=D0=B8=D0=B9=20%=20=D0=B7=D0=B0?= =?UTF-8?q?=D0=B3=D1=80=D1=83=D0=B6=D0=B5=D0=BD=D0=BD=D0=BE=D1=81=D1=82?= =?UTF-8?q?=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Services/StatisticsService.php | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/app/Services/StatisticsService.php b/app/Services/StatisticsService.php index b10fe24..c08afe3 100644 --- a/app/Services/StatisticsService.php +++ b/app/Services/StatisticsService.php @@ -303,6 +303,8 @@ class StatisticsService 'preoperativeSum' => 0, 'preoperativePatientCount' => 0, + 'percentLoaded' => 0, + 'staff_sum' => 0, 'observable_sum' => 0, 'unwanted_sum' => 0, @@ -385,12 +387,14 @@ class StatisticsService { $outcomeSum = $total['outcome_sum']; $preopPatients = $total['preoperativePatientCount']; + $consistSum = $total['consist_sum'] ?? 0; + $bedsSum = $total['beds_sum'] ?? 0; return [ 'isTotalRow' => ! $isGrandTotal, 'isGrandTotal' => $isGrandTotal, 'department' => $isGrandTotal ? 'ОБЩИЕ ИТОГИ:' : 'ИТОГО:', - 'beds' => $total['beds_sum'], + 'beds' => $bedsSum, 'recipients' => [ 'all' => $total['recipients_all_sum'], 'plan' => $total['recipients_plan_sum'], @@ -398,8 +402,10 @@ class StatisticsService 'transferred' => $total['recipients_transferred_sum'], ], 'outcome' => $outcomeSum, - 'consist' => $total['consist_sum'], - 'percentLoadedBeds' => '—', + 'consist' => $consistSum, + 'percentLoadedBeds' => $consistSum > 0 + ? round(($consistSum / $bedsSum) * 100) + : 0, // '—', 'surgical' => [ 'plan' => $total['plan_surgical_sum'], 'emergency' => $total['emergency_surgical_sum'],