<?php

namespace app\common\model;

use think\Model;

class OutFollow extends Model
{
    // 设置字段信息
    protected $schema = [
        'id'         => 'int',
        'resume_id'  => 'int',
        'status'     => 'int',
        'remark'     => 'string',
        'createtime' => 'int',
    ];

    // 设置字段自动转换类型
    protected $type = [
        'createtime' => 'timestamp:Y-m-d H:i:s',
    ];

    public static $status = [1 => '未跟进', 2 => '未面试', 3 => '面试通过', 4 => '面试未通过', 5 => '用户放弃', 6 => '已入职', 7 => '已离职'];

    public function getStatusTextAttr($value, $data)
    {
        return self::$status[$data['status']];
    }

    // 关联User
    public function resume()
    {
        return $this->hasOne(OutResume::class, "id", "resume_id");
    }


}