<?php

namespace app\admin\model;

use app\BaseModel;
class Admin extends BaseModel
{
    
    protected $autoWriteTimestamp = true;
    protected $createTime = 'created_at';
    protected $updateTime = 'updated_at';

    public function role()
    {
    return $this->hasOne(Role::class, 'id', 'role_id')->field(['id', 'name']);
    }
    public function department()
    {
        return $this->hasOne(Department::class, 'id', 'department_id')->field(['id', 'name']);
    }
    
}