mirror of https://gitee.com/karson/fastadmin.git
修复 User 模型附加字段不存在时导致接口报错的 BUG。
parent
99c3fac317
commit
bbf728b5e6
|
|
@ -68,21 +68,22 @@ class User extends Model
|
||||||
return ['normal' => __('Normal'), 'hidden' => __('Hidden')];
|
return ['normal' => __('Normal'), 'hidden' => __('Hidden')];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public function getPrevtimeTextAttr($value, $data)
|
public function getPrevtimeTextAttr($value, $data)
|
||||||
{
|
{
|
||||||
$value = $value ? $value : $data['prevtime'];
|
$value = $value ? $value : $data['prevtime'] ?? "";
|
||||||
return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value;
|
return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getLogintimeTextAttr($value, $data)
|
public function getLogintimeTextAttr($value, $data)
|
||||||
{
|
{
|
||||||
$value = $value ? $value : $data['logintime'];
|
$value = $value ? $value : $data['logintime'] ?? "";
|
||||||
return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value;
|
return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getJointimeTextAttr($value, $data)
|
public function getJointimeTextAttr($value, $data)
|
||||||
{
|
{
|
||||||
$value = $value ? $value : $data['jointime'];
|
$value = $value ? $value : $data['jointime'] ?? "";
|
||||||
return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value;
|
return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue