模块修改

This commit is contained in:
2025-11-17 16:42:14 +08:00
parent b82dac2ddd
commit 0b69fc5ddd
13 changed files with 103 additions and 159 deletions

View File

@@ -1,8 +1,8 @@
<?php
namespace app\guildAdmin\library;
namespace app\guildadmin\library;
use app\guildAdmin\model\Admin;
use app\guildadmin\model\Admin;
use fast\Random;
use fast\Tree;
use think\Cache;
@@ -376,7 +376,7 @@ class Auth extends \fast\Auth
}
}
// 取出所有分组
$groupList = \app\guildAdmin\model\AuthGroup::where($this->isSuperAdmin() ? '1=1' : ['status' => 'normal'])->where('guild_id', Session::get('guild_id'))->select();
$groupList = \app\guildadmin\model\AuthGroup::where($this->isSuperAdmin() ? '1=1' : ['status' => 'normal'])->where('guild_id', Session::get('guild_id'))->select();
$objList = [];
foreach ($groups as $k => $v) {
if ($v['rules'] === '*') {
@@ -408,7 +408,7 @@ class Auth extends \fast\Auth
$childrenAdminIds = [];
if (!$this->isSuperAdmin()) {
$groupIds = $this->getChildrenGroupIds(false);
$childrenAdminIds = \app\guildAdmin\model\AuthGroupAccess::where('group_id', 'in', $groupIds)
$childrenAdminIds = \app\guildadmin\model\AuthGroupAccess::where('group_id', 'in', $groupIds)
->column('uid');
} else {
//超级管理员拥有所有人的权限
@@ -495,12 +495,12 @@ class Auth extends \fast\Auth
$selected = $referer = [];
$refererUrl = Session::get('referer');
// 必须将结果集转换为数组
$ruleList = collection(\app\guildAdmin\model\AuthRule::where('status', 'normal')
$ruleList = collection(\app\guildadmin\model\AuthRule::where('status', 'normal')
->where('ismenu', 1)
->order('weigh', 'desc')
->cache("__menu__")
->select())->toArray();
$indexRuleList = \app\guildAdmin\model\AuthRule::where('status', 'normal')
$indexRuleList = \app\guildadmin\model\AuthRule::where('status', 'normal')
->where('ismenu', 0)
->where('name', 'like', '%/index')
->column('name,pid');