chenqp 7 bulan lalu
induk
melakukan
40d96bae53
1 mengubah file dengan 8 tambahan dan 1 penghapusan
  1. 8 1
      app/Service/StatisticsService.php

+ 8 - 1
app/Service/StatisticsService.php

@@ -88,8 +88,15 @@ class StatisticsService extends Service
         }
 
         foreach ($data as $value){
-            if($value['fp_top_depart_id'] > 0){
+            if($value['top_depart_id'] == $value['fp_top_depart_id']){
                 if(isset($return[$value['fp_top_depart_id']])) $return[$value['fp_top_depart_id']]['total'] += 1;
+            }else{
+                if($value['fp_top_depart_id'] > 0){
+                    if(isset($return[$value['fp_top_depart_id']])) $return[$value['fp_top_depart_id']]['total'] += 1;
+                }
+                if($value['top_depart_id'] > 0){
+                    if(isset($return[$value['top_depart_id']])) $return[$value['top_depart_id']]['total'] += 1;
+                }
             }
         }