// +---------------------------------------------------------------------- namespace app\validate\merchant; use think\Validate; class OpenAuthValidate extends Validate { protected $failException = true; protected $rule = [ 'title|标题' => 'require', 'access_key|accessKey' => 'require|unique:open_auth,access_key', 'auth|权限' => 'require|checkAuth', ]; public function checkAuth() { return true; } public function sceneEdit() { return $this->only(['title','auth']); } }