完善错误提示页面

This commit is contained in:
cxdbz committed 2019-06-17 21:36:44 +08:00
1 parent 30185b533b
commit f39f4982bd
9 files changed
+68 -232

No files matched your search

+7 -7
View File
@@ -133,18 +133,17 @@ class Index extends Base
public function read($id)
{
// 获取管理员信息
$ad = new AD;
$list = AD::where('id',$id)
->field('id,xingming,sex,shengri,username,school,phone,denglucishu,lastip,ip,lasttime,thistime,create_time,update_time')
->with([
'adSchool'=>function($query){
$query->field('id,title');
}
,'glGroup'=>function($query){
$query->where('status',1)->field('title,rules,miaoshu');
}
])
->find();
$list['webtitle'] = '帐号信息';
$list->groupnames = $ad->getGroupnames($id);
// 模板赋值
$this->assign('list',$list);
@@ -158,18 +157,19 @@ class Index extends Base
public function myinfo()
{
$id = session('userid');
$ad = new AD;
// 获取管理员信息
$list = AD::where('id',$id)
$list = $ad->where('id',$id)
->field('id,xingming,sex,shengri,username,school,phone,denglucishu,lastip,ip,lasttime,thistime,create_time,update_time')
->with([
'adSchool'=>function($query){
$query->field('id,title');
}
,'glGroup'=>function($query){
$query->where('status',1)->field('title,rules,miaoshu');
}
])
->find();
$list->groupnames = $ad->getGroupnames($id);
$list['webtitle'] = '我的信息';
// 模板赋值
+28 -36
View File
@@ -104,44 +104,36 @@ class Admin extends Base
}
// // 获取角色id表
// public function getGroupidsAttr()
// {
// // 获取当前当前管理员信息
// $admin = $this->get($this->getAttr('id'));
// // 获取角色id
// $list = $admin->authgroup()->column('group_id');
// 获取角色名称
public function getGroupnames($userid)
{
// 如果用户ID为1或2,则为超级管理员
if($userid == 1 || $userid == 2)
{
return '超级管理员';
}
// $str = '';
// // 将角色id转换成数组
// foreach ($list as $key => $value) {
// $key == 0 ? $str =$value : $str = $str.','.$value;
// }
// 查询用户拥有的权限
$admininfo = $this->where('id',$userid)
->field('id')
->with([
'glGroup'=>function($query){
$query->where('status',1)->field('title');
}
])
->find();
$groupname = '';
foreach ($admininfo->gl_group as $key => $value) {
if($key == 0){
$groupname = $value->title;
}else{
$groupname = $groupname.'、'.$value->title;
}
}
// // 返回值
// return $str;
// }
// // 获取角色名称
// public function getGroupnamesAttr()
// {
// // 获取角色id
// $group = $this->get($this->getAttr('id'))->append(['groupids']);
// $str = '';
// // 查询角色名称
// $grouplist= db('AuthGroup')->where('id','in',$group->groupids)->column('title');
// // 重组角色名
// foreach ($grouplist as $key => $value) {
// if($key == 0){
// $str = $value;
// }else{
// $str = $str.'、'.$value;
// }
// }
// // 返回角色名
// return $str;
// }
// 返回角色名
return $groupname;
}
// 单位关联模型
public function adSchool()
+1 -1
View File
@@ -71,7 +71,7 @@
}},
{field: 'phone', title: '联系电话', minWidth:130, sort: true},
{field: 'denglucishu', title: '登录次数', minWidth:100, sort: true},
{field: 'thistime', title: '最后登录时间', minWidth:130, sort: true},
{field: 'thistime', title: '最后登录时间', minWidth:180, sort: true},
{field: 'ip', title: '最后登录地址', minWidth:150, sort: true},
{field: 'status', title: '状态',templet:'#status', sort: true},
{field: 'id', title: '操作',toolbar: '#barDemo',minWidth:140}
Loaded 3 of 9 files, more files were not shown because too many files have changed in this diff. Show more