<?php
namespace app\common\model;

use think\Model;

class ComjobsStar extends Model
{
	// 设置字段信息
    protected $schema = [
        'id'			=> 'int',
		'comjobsid'		=> 'int',
		'userid'		=> 'int',
        'createtime'	=> 'int'
    ];
	
	// 设置字段自动转换类型
	protected $type = [
        'createtime'  => 'timestamp:Y-m-d H:i:s'
    ];
	
	// 关联Comjobs
	public function comjobs()
	{
	    return $this->hasOne(Comjobs::class, "id", "comjobsid");
	}
	
	// 关联User
	public function user()
	{
	    return $this->hasOne(User::class, "id", "userid");
	}

}