改进model类

This commit is contained in:
thinkphp
2016-02-19 10:50:10 +08:00
parent f2958e922d
commit e7ad730317

View File

@@ -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;