修复管理员新建用户后查看未登录过的用户时出错的问题
*问题是后加的XX day ago功能导致
This commit is contained in:
parent
20e25b7441
commit
ddb076cf31
@ -86,7 +86,10 @@ $this->registerCssFile('@web/css/admin-userv.css');
|
||||
}],
|
||||
['attribute' => 'last_login', 'label' => '最后登录时间', 'value' => function ($model) {
|
||||
// 日期时间 (xx天前)
|
||||
return $model->last_login . ' (' . Yii::$app->formatter->asRelativeTime(new DateTime($model->last_login, new DateTimeZone('GMT+8'))) . ')';
|
||||
if($model->last_login !== null){
|
||||
return $model->last_login . ' (' . Yii::$app->formatter->asRelativeTime(new DateTime($model->last_login, new DateTimeZone('GMT+8'))) . ')';
|
||||
}
|
||||
return $model->last_login;
|
||||
}],
|
||||
['attribute' => 'last_login_ip', 'label' => '上次登录IP', 'value' => function ($model) use ($IPLocation) {
|
||||
if (Yii::$app->params['enableIpInfo']) {
|
||||
|
Loading…
Reference in New Issue
Block a user