优化工作台

This commit is contained in:
hdm 2023-04-07 09:13:46 +08:00
parent 2443f4b55b
commit feb8d88393
2 changed files with 3 additions and 2 deletions

View File

@ -61,6 +61,7 @@ abstract class BaseController
$this->action = strtolower($this->request->action());
$this->uid = 0;
$this->did = 0;
$this->pid = 0;
// 控制器初始化
$this->initialize();
}
@ -89,6 +90,7 @@ abstract class BaseController
$this->uid = Session::get($session_admin);
$login_admin = Db::name('Admin')->where(['id' => $this->uid])->find();
$this->did = $login_admin['did'];
$this->pid = $login_admin['position_id'];
View::assign('login_admin', $login_admin);
$is_lock = $login_admin['is_lock'];
if($is_lock==1){

View File

@ -237,8 +237,7 @@ class Index extends BaseController
);
}
$position_id = Db::name('Admin')->where('id',$this->uid)->value('position_id');
$adminGroup = Db::name('PositionGroup')->where(['pid' => $position_id])->column('group_id');
$adminGroup = Db::name('PositionGroup')->where(['pid' => $this->pid])->column('group_id');
$adminLayout = Db::name('AdminGroup')->where('id', 'in', $adminGroup)->column('layouts');
$adminLayouts = [];
foreach ($adminLayout as $k => $v) {