[更新]修复用户登录日期及次数显示处理

This commit is contained in:
Anyon 2018-05-07 10:43:41 +08:00
parent a354cc649b
commit 8c433686d5
2 changed files with 2 additions and 4 deletions

View File

@ -64,7 +64,7 @@ class Login extends BasicAdmin
($user['password'] !== md5($password)) && $this->error('登录密码与账号不匹配,请重新输入!');
empty($user['status']) && $this->error('账号已经被禁用,请联系管理!');
// 更新登录信息
$data = ['login_at' => ['exp', 'now()'], 'login_num' => ['exp', 'login_num+1']];
$data = ['login_at' => Db::raw('now()'), 'login_num' => Db::raw('login_num+1')];
Db::name('SystemUser')->where(['id' => $user['id']])->update($data);
session('user', $user);
!empty($user['authorize']) && NodeService::applyAuthNode();

View File

@ -88,9 +88,7 @@
<td class='text-left nowrap'>
{$vo.mail|default="<span class='color-desc'>还没有设置邮箱</span>"|raw}
</td>
<td class='text-left nowrap'>
{$vo.login_num|default="<span class='color-desc'>从未登录</span>"|raw}
</td>
<td class='text-left nowrap'>{$vo.login_num|default=0}</td>
<td class='text-left nowrap'>
{$vo.login_at|format_datetime|default="<span class='color-desc'>从未登录</span>"|raw}
</td>