<?php

namespace app\common\model\odd_job;

use think\Model;

class WorkerModel extends Model
{
    protected $connection = 'odd_job';

    //设置表名
    protected $name = 'worker';

    protected $type = [
        'createtime' => 'timestamp:Y-m-d H:i:s',
    ];

    public function getWtypeTextAttr($value, $data)
    {
        $wtype = [1 => '个人雇主', 2 => '企业雇主'];
        return $wtype[$data['wtype']];
    }

    public function getStatusTextAttr($value, $data)
    {
        $status = [1 => '待审核', 2 => '未通过', 3 => '被禁用', 4 => '升级审核', 5 => '正常中'];
        return $status[$data['status']];
    }
}