chenqp 7 月之前
父節點
當前提交
40d96bae53
共有 1 個文件被更改,包括 8 次插入1 次删除
  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;
+                }
             }
         }