This commit is contained in:
Your Name
2026-05-05 13:28:45 +08:00
parent 81b2808eaf
commit d6e105f912
19 changed files with 3730 additions and 267 deletions
+7 -3
View File
@@ -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);
}