cqp 2 mesiacov pred
rodič
commit
6b105e9df5
1 zmenil súbory, kde vykonal 8 pridanie a 7 odobranie
  1. 8 7
      app/Service/StatisticsService.php

+ 8 - 7
app/Service/StatisticsService.php

@@ -3591,13 +3591,13 @@ class StatisticsService extends Service
 
         $map = [];
         foreach ($list as $value) {
-            if(isset($map[$value['top_depart_id']])) {
-                $tmp = bcadd($value['receipt'], $map[$value['top_depart_id']]['num_1']);
-                $tmp2 = bcadd($value['contract_fee'], $map[$value['top_depart_id']]['num_2']);
-                $map[$value['top_depart_id']]['num_1'] = $tmp;
-                $map[$value['top_depart_id']]['num_2'] = $tmp2;
+            if(isset($map[$value['from_top_depart_id']])) {
+                $tmp = bcadd($value['receipt'], $map[$value['from_top_depart_id']]['num_1']);
+                $tmp2 = bcadd($value['contract_fee'], $map[$value['from_top_depart_id']]['num_2']);
+                $map[$value['from_top_depart_id']]['num_1'] = $tmp;
+                $map[$value['from_top_depart_id']]['num_2'] = $tmp2;
             }else{
-                $map[$value['top_depart_id']] = [
+                $map[$value['from_top_depart_id']] = [
                     'num_1' => $value['receipt'],
                     'num_2' => $value['contract_fee'],
                 ];
@@ -3823,7 +3823,8 @@ class StatisticsService extends Service
             $area[] = [
                 'label' => $value,
                 'value' => $key,
-                'list' => []
+                'list' => [],
+                'count' => 0,
             ];
         }