diff --git a/application/index/controller/Index.php b/application/index/controller/Index.php index 9ef9eb91..c77bda92 100644 --- a/application/index/controller/Index.php +++ b/application/index/controller/Index.php @@ -94,18 +94,39 @@ class Index extends Base //实例化数据模型 $sysbasemod = new sysbasemod(); - // 查询最新记录 + // 查询系统设置 $list = $sysbasemod ->order(['id'=>'desc']) ->field('webtitle,thinks,danwei') ->find(); - // 查询用户登录次数 + // 查询用户登信息 $list['username'] = session('username'); + // 查询用户组 + $admin = new \app\admin\model\Admin; + $admininfo = $admin->where('username',$list['username']) + ->field('id') + ->with([ + 'glGroup'=>function($query){ + $query->where('status',1)->field('title,rules,miaoshu'); + } + ]) + ->find(); + $list['group'] = ''; + foreach ($admininfo->gl_group as $key => $value) { + if($key==0) + { + $list['group'] = $value->title; + }else{ + $list['group'] = $list['group'].'、'.$value->title; + } + } + $list['server'] = request()->server(); // 获取版本号 $list->version = config('app.chengji.version'); + // 考试数 $con = new \app\kaoshi\model\Kaoshi; $list['kaoshi'] = $con->count(); diff --git a/application/index/view/index/welcome.html b/application/index/view/index/welcome.html index 0d408f37..bd0fd47a 100644 --- a/application/index/view/index/welcome.html +++ b/application/index/view/index/welcome.html @@ -12,7 +12,7 @@
-
欢迎管理员: +
欢迎{$list.group}: {$list['username']}!当前时间:{php} echo date('Y-m-d h:m:s'){/php}