<?php
/**
* @author 龙虾 <15108148@qq.com>
* @version 2.0 2020-08-06
* @copyright 睿谷信息 <www.rgxx.com>
*/
namespace app\admin\validate;
use think\Validate;

class Adminrule extends Validate
{
	
	protected $rule = [
		'title|标题'       => 'require|min:2',
		'name|规则'        => 'require|unique:adminrule|min:4',
		'pid|所属'         => 'require|integer',
		'status|权限开关'  => 'in:0,1',
		'torder|排序'      => '>:0|integer'
	];

	// 目录场景
	public function sceneDirectory()
	{
		return $this->only(['title','pid','torder']);
	}
}