更新
This commit is contained in:
@@ -14,7 +14,6 @@
|
||||
|
||||
namespace app\adminapi\logic\dept;
|
||||
|
||||
use app\common\enum\YesNoEnum;
|
||||
use app\common\logic\BaseLogic;
|
||||
use app\common\model\auth\Admin;
|
||||
use app\common\model\auth\AdminDept;
|
||||
@@ -271,11 +270,16 @@ class DeptLogic extends BaseLogic
|
||||
*/
|
||||
public static function getAllData()
|
||||
{
|
||||
$data = Dept::where(['status' => YesNoEnum::YES])
|
||||
->order(['sort' => 'desc', 'id' => 'desc'])
|
||||
// 与业绩看板等统计口径一致:含全部未软删部门(不再仅限 status=启用),
|
||||
// 避免外链 assistant_dept_id 在树下拉中不存在导致 TreeSelect 初始化异常。
|
||||
$data = Dept::order(['sort' => 'desc', 'id' => 'desc'])
|
||||
->select()
|
||||
->toArray();
|
||||
|
||||
if ($data === []) {
|
||||
return [];
|
||||
}
|
||||
|
||||
$pid = min(array_column($data, 'pid'));
|
||||
return self::getTree($data, $pid);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user