From e79b3322ce5a7338cb9eaee5a858d4d11b41ca48 Mon Sep 17 00:00:00 2001 From: thinkphp Date: Sun, 6 Mar 2016 20:01:37 +0800 Subject: [PATCH] =?UTF-8?q?=E8=87=AA=E5=8A=A8=E6=B3=A8=E5=86=8C=E6=A8=A1?= =?UTF-8?q?=E5=9E=8B=E7=B1=BB=E5=AE=9A=E4=B9=89=E7=9A=84rule=E8=A7=84?= =?UTF-8?q?=E5=88=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/think/Model.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/library/think/Model.php b/library/think/Model.php index 739f95b5..c0b6b65a 100644 --- a/library/think/Model.php +++ b/library/think/Model.php @@ -991,6 +991,9 @@ class Model // 验证前清空error $this->error = ''; if (!empty($this->options['validate'])) { + if (!empty($this->rule)) { + Validate::rule($this->rule); + } if (!Validate::check($data, $this->options['validate'])) { $this->error = Validate::getError(); return false;