From 4407474d2be13544e2d1dcbabfa195d4436e3741 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E6=9D=BE=E6=A0=91?= Date: Tue, 11 Jun 2019 16:54:39 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=AC=A2=E8=BF=8E=E9=A1=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/index/controller/Index.php | 25 +++++++++++++++++++++-- application/index/view/index/welcome.html | 2 +- 2 files changed, 24 insertions(+), 3 deletions(-) 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}