mirror of
https://gitee.com/zoujingli/ThinkAdmin.git
synced 2025-04-06 03:58:04 +08:00
Update NodeService.php
This commit is contained in:
parent
16aa9ecf29
commit
3f092b53b7
@ -235,14 +235,10 @@ class NodeService
|
|||||||
if (($uid = session('admin_user.id'))) {
|
if (($uid = session('admin_user.id'))) {
|
||||||
session('admin_user', Db::name('SystemUser')->where(['id' => $uid])->find());
|
session('admin_user', Db::name('SystemUser')->where(['id' => $uid])->find());
|
||||||
}
|
}
|
||||||
$authorize = session('admin_user.authorize');
|
if (($aids = session('admin_user.authorize'))) {
|
||||||
if (!empty($authorize) && $authids = explode(',', $authorize)) {
|
$where = [['status', 'eq', '1'], ['id', 'in', explode(',', $aids)]];
|
||||||
$auths = Db::name('SystemAuth')->where(['status' => '1'])->whereIn('id', $authids)->column('id');
|
$subsql = Db::name('SystemAuth')->field('id')->where($where)->buildSql();
|
||||||
if (empty($auths)) {
|
session('admin_user.nodes', array_unique(Db::name('SystemAuthNode')->whereRaw("auth in {$subsql}")->column('node')));
|
||||||
session('admin_user.nodes', []);
|
|
||||||
} else {
|
|
||||||
session('admin_user.nodes', array_unique(Db::name('SystemAuthNode')->whereIn('auth', $auths)->column('node')));
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
session('admin_user.nodes', []);
|
session('admin_user.nodes', []);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user