diff --git a/app/admin/model/Admin.php b/app/admin/model/Admin.php index 6f6f3eb2..eeb6c96b 100755 --- a/app/admin/model/Admin.php +++ b/app/admin/model/Admin.php @@ -433,6 +433,13 @@ class Admin extends BaseModel } + // 初始密码过期时间获取器 + public function getGuoqiAttr($value) + { + return date('Y年m月d日 H:i:s', $value); + } + + // 获取角色名称 public function getGroupnamesAttr($value) { diff --git a/app/index/controller/Index.php b/app/index/controller/Index.php index 2cd51705..4488138b 100755 --- a/app/index/controller/Index.php +++ b/app/index/controller/Index.php @@ -48,11 +48,13 @@ class Index extends AdminBase $admin = new \app\admin\model\Admin; $list['xingming'] = $admin->where('id',session('user_id')) ->value('xingming'); - $create_time = $admin->where('id',session('user_id')) - ->value('create_time'); - $create_time = date("Y-m-d G:i:s", $create_time); - $jyshijian = config('shangma.mimaguoqi'); - $list['create_time'] = strtotime("$create_time+".$jyshijian." day"); + + // 过期时间 + $guoqi = $admin->where('id', session('user_id')) + ->field('guoqi') + ->find(); + $list['guoqi'] = $guoqi->guoqi; + $list['group'] = $admin->searchOne(session('user_id'))->groupnames; diff --git a/app/index/view/index/welcome.html b/app/index/view/index/welcome.html index ee54dace..71c86138 100755 --- a/app/index/view/index/welcome.html +++ b/app/index/view/index/welcome.html @@ -44,7 +44,7 @@
- 您正在使用初始密码,为了保障信息安全,初始密码将于{$list.create_time}停用,请及时 + 您正在使用初始密码,为了保障信息安全,初始密码将于 {$list.guoqi} 停用,请及时 修改密码 diff --git a/app/login/controller/Index.php b/app/login/controller/Index.php index 33902c02..8baef75d 100755 --- a/app/login/controller/Index.php +++ b/app/login/controller/Index.php @@ -69,12 +69,10 @@ class Index extends BaseController $admin = new \app\admin\model\Admin; $userinfo = $admin::where('username|phone', $list['username']) ->where('status', 1) - ->field('id, lastip, username, ip, denglucishu, lasttime, thistime, password, create_time') + ->field('id, lastip, username, ip, denglucishu, lasttime, thistime, password, guoqi') ->find(); - $jyshijian = config('shangma.mimaguoqi'); $now = time(); - $jinyong = strtotime("$userinfo->create_time+".$jyshijian." day"); - if ($jinyong < $now && $list['password'] == '123456') { + if ($userinfo->getData("guoqi") < $now && $list['password'] == '123456') { $userinfo->status = false; } // 将本次信息上传到服务器上