From c8194f3089eec1c18fbb7a2e518b0d69dc6ebf80 Mon Sep 17 00:00:00 2001 From: "as2252258@163.com" Date: Sat, 17 Sep 2022 19:28:53 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=98=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- UniqueValidator.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/UniqueValidator.php b/UniqueValidator.php index 419c3fd..9cedb8b 100644 --- a/UniqueValidator.php +++ b/UniqueValidator.php @@ -20,10 +20,10 @@ class UniqueValidator extends BaseValidator */ public function trigger(): bool { - if (empty($model)) { + if (empty($this->model)) { return $this->addError('model','Model error.'); } - if (!$model->getIsNowExample()) { + if (!$this->model->getIsNowExample()) { return true; } return $this->_validator($this->field, function ($field, $params, $model) {