]> gitweb.erp-flowers.ru Git - erp24_rep/yii-erp24/.git/commitdiff
убираем дублирование админов
authorVladimir Fomichev <vladimir.fomichev@erp-flowers.ru>
Sat, 1 Nov 2025 13:28:19 +0000 (16:28 +0300)
committerVladimir Fomichev <vladimir.fomichev@erp-flowers.ru>
Sat, 1 Nov 2025 13:28:19 +0000 (16:28 +0300)
erp24/api3/core/services/ReportService.php

index 647dd5ffe25e3e4b6059ad355e3da8b33a92006e..e6188d0a81da58ab13f73f62bc8162b2c0462d2a 100644 (file)
@@ -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); // Освобождаем ссылку после цикла
                         }
                     }
                 }