From: Vladimir Fomichev Date: Sat, 1 Nov 2025 13:28:19 +0000 (+0300) Subject: убираем дублирование админов X-Git-Url: https://gitweb.erp-flowers.ru/?a=commitdiff_plain;h=924176ada8f2bc706a0a86e4b6168ed20275e8b1;p=erp24_rep%2Fyii-erp24%2F.git убираем дублирование админов --- diff --git a/erp24/api3/core/services/ReportService.php b/erp24/api3/core/services/ReportService.php index 647dd5ff..e6188d0a 100644 --- a/erp24/api3/core/services/ReportService.php +++ b/erp24/api3/core/services/ReportService.php @@ -359,6 +359,11 @@ class ReportService 'shift_id' => $timetable['shift_id'], ]; } + + // Преобразуем индексированный массив обратно в обычный для совместимости с остальным кодом + foreach ($adminNames as $storeId => $admins) { + $adminNames[$storeId] = array_values($admins); + } $storeVisitorsQuantityTotal = 0; $storeSaleQuantityTotal = 0; @@ -427,6 +432,7 @@ class ReportService $adminRecord["bonus_new_user_count"] = (int)($storeSaleByAdminId[$adminRecord['id']]['newBonusUserCount'] ?? 0); $adminRecord["bonus_repeat_user_count"] = (int)($storeSaleByAdminId[$adminRecord['id']]['repeatBonusUserCount'] ?? 0); } + unset($adminRecord); // Освобождаем ссылку после цикла } $totalWriteOffsPerDate = (int)($totalWriteOffsByStoreId[$store->id] ?? 0); @@ -450,6 +456,7 @@ class ReportService $adminRecord["total_" . $spec . "_per_day_percent"] = 0; } } + unset($adminRecord); // Освобождаем ссылку после цикла } foreach ($specificSales[$spec] as $specificSale) { if ($specificSale['store_id'] == $store->id) { @@ -464,6 +471,7 @@ class ReportService } } } + unset($adminRecord); // Освобождаем ссылку после цикла } } }