Browse Source

菜单按钮

cqpCow 1 year ago
parent
commit
52902f5dec
1 changed files with 6 additions and 5 deletions
  1. 6 5
      app/Service/EmployeeService.php

+ 6 - 5
app/Service/EmployeeService.php

@@ -434,12 +434,13 @@ class EmployeeService extends Service
         if(! empty($data['code'])) $model->where('code', 'LIKE', '%'.$data['code'].'%');
 
         $list = $model->get()->toArray();
-//        if(! empty($list)) {
-//            $list = $this->makeTree(0,$list);
-//            $list = $this->set_sort_circle($list);
-//        }
+        $list_tree = $list;
+        if(! empty($list_tree)) {
+            $list_tree = $this->makeTree(0,$list_tree);
+            $list_tree = $this->set_sort_circle($list_tree);
+        }
 
-        return [200,$list];
+        return [200,['data' => $list,'tree' => $list_tree]];
     }
 
     public function departRule($data, $is_check = true){