cqpCow 1 anno fa
parent
commit
7232eb2db3
1 ha cambiato i file con 2 aggiunte e 0 eliminazioni
  1. 2 0
      app/Service/EmployeeService.php

+ 2 - 0
app/Service/EmployeeService.php

@@ -1020,6 +1020,7 @@ class EmployeeService extends Service
                     if($value['is_main']) {//是总公司
                         //所有部门都有
                         $rule = array_column($list,'id');
+                        $rule[] = 0;
                     }else{//不是总公司
                         //自己以及子部门
                         $depart_id = array_merge(self::getAllIds($list,$map[$value['depart_id']]),[$map[$value['depart_id']]]);
@@ -1031,6 +1032,7 @@ class EmployeeService extends Service
                         if(! empty($depart_map[$top_tmp]['is_main'])){
                             //顶级公司是总公司 所有部门都有
                             $rule = array_column($list,'id');
+                            $rule[] = 0;
                         }else{
                             //顶级公司是分公司 分公司所有部门
                             $depart_id = array_merge(self::getAllIds($list,$top_tmp),[$top_tmp]);