diff --git a/app/admin/controller/nk/User.php b/app/admin/controller/nk/User.php index 10b13dd..d4624a3 100644 --- a/app/admin/controller/nk/User.php +++ b/app/admin/controller/nk/User.php @@ -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); diff --git a/app/admin/view/nk/user/auths.html b/app/admin/view/nk/user/auths.html index 89c32bd..b5af6ef 100644 --- a/app/admin/view/nk/user/auths.html +++ b/app/admin/view/nk/user/auths.html @@ -75,7 +75,11 @@