<?php
namespace app\common\model;

use think\Model;

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

	// 关联WorkerShare
	public function workerShare()
	{
	    return $this->hasMany(WorkerShare::class, "cateid", "id")->order(['priority'=>'desc','id'=>'desc']);
	}

	
}