更新目录结构
This commit is contained in:
@@ -11,7 +11,7 @@ namespace app\controller\auth;
|
||||
use think\facade\Request;
|
||||
use app\model\auth\Departments;
|
||||
use app\services\auth\DepartmentService;
|
||||
use sent\tree\Tree;
|
||||
use Xin\Support\Arr;
|
||||
use app\controller\Base;
|
||||
|
||||
class Department extends Base {
|
||||
@@ -35,7 +35,7 @@ class Department extends Base {
|
||||
}
|
||||
}
|
||||
}
|
||||
$tree = (new Tree())->listToTree($list, 'id', 'parent_id', 'children', $root);
|
||||
$tree = Arr::tree($list, null, 0, ['id'=>'id', 'parent' => 'parent_id', 'child' => 'children']);
|
||||
if(empty($tree)){
|
||||
$this->data['data'] = $list;
|
||||
}else{
|
||||
|
||||
Reference in New Issue
Block a user