From 2fcf0b3ee40ba24a88e0c2271bf73f86a7b54b3a Mon Sep 17 00:00:00 2001 From: thinkphp Date: Thu, 18 Feb 2016 17:39:52 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E8=BF=9B=E9=AA=8C=E8=AF=81=E8=A7=84?= =?UTF-8?q?=E5=88=99=E5=92=8C=E5=AE=8C=E6=88=90=E8=A7=84=E5=88=99=20?= =?UTF-8?q?=E6=94=AF=E6=8C=81=E5=90=8C=E4=B8=80=E4=B8=AA=E5=AD=97=E6=AE=B5?= =?UTF-8?q?=E7=9A=84=E5=A4=9A=E6=AC=A1=E9=AA=8C=E8=AF=81=E5=92=8C=E5=AE=8C?= =?UTF-8?q?=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/think/Model.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/library/think/Model.php b/library/think/Model.php index 571c8e98..3a7853d6 100644 --- a/library/think/Model.php +++ b/library/think/Model.php @@ -996,6 +996,9 @@ class Model $options['value_validate'] = isset($options['value_validate']) ? $options['value_validate'] : []; $options['exists_validate'] = isset($options['exists_validate']) ? $options['exists_validate'] : []; foreach ($rules as $key => $val) { + if (is_numeric($key)) { + $key = array_shift($val); + } if (!empty($scene) && !in_array($key, $scene)) { continue; } @@ -1048,6 +1051,9 @@ class Model $options['value_fill'] = isset($options['value_fill']) ? $options['value_fill'] : []; $options['exists_fill'] = isset($options['exists_fill']) ? $options['exists_fill'] : []; foreach ($rules as $key => $val) { + if (is_numeric($key)) { + $key = array_shift($val); + } if (!empty($scene) && !in_array($key, $scene)) { continue; }