From e7ad730317600af65f4be054e4cff723aece3a2f Mon Sep 17 00:00:00 2001 From: thinkphp Date: Fri, 19 Feb 2016 10:50:10 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E8=BF=9Bmodel=E7=B1=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/think/Model.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/library/think/Model.php b/library/think/Model.php index a6f767de..b3f85b76 100644 --- a/library/think/Model.php +++ b/library/think/Model.php @@ -1128,7 +1128,9 @@ class Model { // 获取数据 支持二维数组 $value = $this->getDataValue($data, $key); - + if (strpos($key, '.')) { + list($name1, $name2) = explode('.', $key); + } if ((in_array($key, $options['value_fill']) && '' == $value) || (in_array($key, $options['exists_fill']) && is_null($value))) { // 不满足自动填充条件 @@ -1166,7 +1168,6 @@ class Model } } if (strpos($key, '.')) { - list($name1, $name2) = explode('.', $key); $data[$name1][$name2] = $result; } else { $data[$key] = $result;