<?php

namespace app\model\system;

use app\extra\basic\Model;
use think\model\relation\HasOne;


/**
 * @property integer $id (主键)
 * @property integer $agent_id 代理ID
 * @property string $username 用户名
 * @property string $truename 真实姓名
 * @property string $password 密码
 * @property mixed $salt 密钥串
 * @property integer $status 状态
 * @property integer $type 1管理员2代理子账号3店铺账号
 * @property integer $is_deleted 删除状态
 * @property integer $is_super 
 * @property string $remark 备注
 * @property string $login_ip 登录IP
 * @property mixed $login_at 登录时间
 * @property integer $login_num 
 * @property string $create_ip 
 * @property mixed $updated_at 更新时间
 * @property mixed $create_at 创建时间
 */
class SystemUser extends Model
{
    /**
     * The connection name for the model.
     *
     * @var string|null
     */
    protected $connection = 'mysql';
    
    /**
     * The table associated with the model.
     *
     * @var string
     */
    protected string $table = "system_user";
    
    /**
     * The primary key associated with the table.
     *
     * @var string
     */
    protected string $primaryKey = "id";
    
    /**
     * Indicates if the model should be timestamped.
     *
     * @var bool
     */
    public bool $timestamps = false;

    public function account(): HasOne
    {
        return $this->hasOne("app\model\saas\SaasShop","shop_id","agent_id");
    }

}
