diff --git a/control/index.php b/control/index.php index ea06388..20027b9 100644 --- a/control/index.php +++ b/control/index.php @@ -54,7 +54,9 @@ class index extends publicBase { $user_info = $this->get_user_info(); if (!$user_info['is_super_admin']) $this->ajax_json(false, '您还有此权限'); - $condition = array('is_super_admin' => ADMIN_USER_NOT_SUPER); + $condition = array('aid'=>$user_info['aid']); + if ($user_info['aid'] == 0) $condition = array(); + $cur_page = $this->post('currentPage') ? $this->post('currentPage') : 1; $page_size = $this->post('pageSize') ? $this->post('pageSize') : 20; @@ -68,6 +70,7 @@ class index extends publicBase { 'last_page' => ceil($total / $page_size), 'cur_page' => $cur_page, 'list' => $user_list, + 'aid' => $user_info['aid'], ); $this->ajax_json(true, '获取成功', $rdata); diff --git a/view/js/subCount.js b/view/js/subCount.js index c8340ae..72de4ca 100644 --- a/view/js/subCount.js +++ b/view/js/subCount.js @@ -82,22 +82,35 @@ $(document).ready(function () { function renderData(data){ totalPages = data.last_page; var pageData = data.list + var login_aid = data.aid + $('#tbody-wrap').empty() renderList() var html = ''; pageData.forEach((item)=>{ - html += ` + let aidHtml = ''; + if(login_aid == 0){ + aidHtml = `${item.aid}` + } + + let switchHtml = ''; + if((item.is_super_admin == 0 || login_aid == 0) && item.aid>0){ + switchHtml = ``; + } + + html += ` + ${aidHtml} ${item.nickname} ${item.realname} ${item.addtime} - + ${switchHtml} - ` + ` $('#tbody-wrap').html(html) }) diff --git a/view/templates/index/user_list.html b/view/templates/index/user_list.html index 620c12e..82685a9 100644 --- a/view/templates/index/user_list.html +++ b/view/templates/index/user_list.html @@ -27,6 +27,9 @@ + {if $_user_info.aid == 0} + + {/if}
AID账号昵称 姓名 添加时间