<?php
namespace app\common\model;

use think\Model;

class WorkerShare extends Model
{
	// 设置字段信息
    protected $schema = [
        'id'			=> 'int',
		'cateid'		=> 'int',
		'title'			=> 'string',
		'tilpic'		=> 'string',
		'status'		=> 'tinyint',
        'priority'		=> 'int'
    ];
	
	public function getStatusTextAttr($value,$data)
	{
		$status = [1=>'显示',2=>'隐藏'];
		return $status[$data['status']];
	}
	
	// 关联WorkerShareCate
	public function workerShareCate()
	{
	    return $this->hasOne(WorkerShareCate::class, "id", "cateid");
	}

	
}