<?php
declare (strict_types=1);

namespace app\api\model;

use app\common\service\FileService;
use think\Model;

class User extends Model
{
    public function getLoginTimeAttr($value)
    {
        return $value ? date('Y-m-d H:i:s', $value) : '';
    }

    public function getAvatarAttr($value)
    {
        return FileService::getFileUrl(trim($value, '/'));
    }
}
