修复后台权限组展示问题

This commit is contained in:
monanxiao 2023-03-21 16:41:13 +08:00
parent 742601af5a
commit 7ba6586b82
2 changed files with 46 additions and 9 deletions

View File

@ -756,17 +756,27 @@ class User extends BaseController
}
//权限组信息
$groupwhere[] = ['id', '<>', 1];
$groupwhereAdmin[] = ['id', '<>', 1];
$groupwhereWeb[] = ['group_id', '<>', 1];
if ($this->adminInfo['group_access'] != 1) { //不是超级管理员
// $www['admin_id'] = $this->adminInfo['id'];
// $user_address = Db::table('fa_szxc_information_useraddress')->where($www)->find();
// if ($user_address) {
if ($this->adminInfo['group_access'] == 2) {
$auth_range = [['name' => '村级', 'value' => '1']];
$groupwhere[] = ['id', '=', 2];
$auth_range = [
['name' => '村级', 'value' => '1'],
];
// $groupwhere[] = ['id', '=', 2];
$groupwhereAdmin[] = ['id', '=', 3];
$groupwhereWeb[] = ['group_id', '=', 3];
}
if ($this->adminInfo['group_access'] == 4) {
$auth_range = [['name' => '村级', 'value' => '1'], ['name' => '乡镇', 'value' => '2']];
$auth_range = [
['name' => '村级', 'value' => '1'],
['name' => '乡镇', 'value' => '2']
];
$groupwhere['id'] = [ '=',[2,4]];
}
@ -778,27 +788,46 @@ class User extends BaseController
// }
// }
} else {
$auth_range = [['name' => '小组', 'value' => '5'],['name' => '村级', 'value' => '1'], ['name' => '乡镇', 'value' => '2'], ['name' => '区县', 'value' => '3'], ['name' => '市级', 'value' => '4']];
$auth_range = [
['name' => '小组', 'value' => '5'],
['name' => '村级', 'value' => '1'],
['name' => '乡镇', 'value' => '2'],
['name' => '区县', 'value' => '3'],
['name' => '市级', 'value' => '4']
];
}
$street = Db::table('fa_geo_area')->where(['switch' => 1, 'city_code' => '510500'])
// 区县
$street = Db::table('fa_geo_area')->where([
'switch' => 1,
'city_code' => '510500'
])
->field('area_id id,area_code code,area_name name')
->select();
//
$brigade = Db::table('fa_geo_brigade')
->limit(30)
->select();
//后端权限
$groupdata = Db::name('admin_group')
->where($groupwhere)
->where($groupwhereAdmin)
->limit(30)
->select();
$groupdata[] = ['id' => 0, 'title' => '无后台权限'];
//前端权限
$user_group = Db::connect('shop')
->table('eb_user_group')
->where($groupwhereWeb)
->limit(30)
->select();
$user_group[] = ['group_id' => 0, 'group_name' => '无前端权限'];
View::assign('id', $params['id']);
View::assign('user_group', $user_group);
View::assign('groupdata', $groupdata);

View File

@ -75,7 +75,11 @@
<div class="layui-input-block">
<select name="groupdata" lay-verify="required">
{volist name='groupdata' id='vo'}
<option value="{$vo.id}" {if $vo.id==$address['admin_group']} selected {/if}>{$vo.title}</option>
{if $vo.id == $address['admin_group']}}
<option value="{$vo.id}" selected>{$vo.title}</option>
{else /}
<option value="{$vo.id}" {if ($vo.id==0) and (!$address['admin_group']) } selected{/if}>{$vo.title}</option>
{/if}
{/volist}
</select>
</div>
@ -85,7 +89,11 @@
<div class="layui-input-block">
<select name="group_id" lay-verify="required">
{volist name='user_group' id='vo'}
<option value="{$vo.group_id}" {if $vo.group_id==$user['group_id']} selected {/if}>{$vo.group_name}</option>
{if $vo.group_id == $user['group_id']}}
<option value="{$vo.group_id}" selected>{$vo.group_name}</option>
{else /}
<option value="{$vo.group_id}" {if ($vo.group_id==0) and ($user['group_id'] == 1) } selected{/if}>{$vo.group_name}</option>
{/if}
{/volist}
</select>
</div>