<?php
namespace app\model\project;

use app\model\project\User;
use think\Model;
use think\model\concern\SoftDelete;

class UserAccount extends Model
{
//    use SoftDelete;

    // 设置当前模型对应的完整数据表名称
    protected $table = 'fj_user_account';

    // 自动时间戳
    protected $autoWriteTimestamp = true;
    protected $createTime = 'createtime';
    protected $updateTime = false;


    // 指定软删除字段
//    protected $deleteTime = 'is_del';

    // 用户关联
    public function user()
    {
        return $this->belongsTo(User::class, 'user_id', 'id')
            ->where('is_del',0)
            ->field('id,username,headico');
    }


}