<?php
namespace app\common\model;

use think\Model;

class WorderLog extends Model
{
	// 设置字段信息
    protected $schema = [
        'id'			=> 'int',
		'getworkerid'	=> 'int',
		'setworkerid'	=> 'int',
		'worderid'		=> 'int',
        'createtime'	=> 'int'
    ];
	
	// 设置字段自动转换类型
	protected $type = [
        'createtime'  => 'timestamp:Y-m-d H:i'
    ];

	// 关联Worder
	public function worder()
	{
	    return $this->hasOne(Worder::class, "id", "worderid");
	}
	
	// 关联Worker
	public function getWorker()
	{
	    return $this->hasOne(Worker::class, "id", "getworkerid");
	}
	
	// 关联Worker
	public function setWorker()
	{
	    return $this->hasOne(Worker::class, "id", "setworkerid");
	}

}