改进Builder类的insertAll方法 过滤非标量数据

This commit is contained in:
thinkphp
2016-05-30 11:31:16 +08:00
parent 67a91a776d
commit 309c79f8c0

View File

@@ -578,8 +578,11 @@ abstract class Builder
throw new Exception(' fields not exists :[' . $key . ']');
}
unset($data[$key]);
} else {
} elseif (is_scalar($val)) {
$data[$key] = $this->parseValue($val);
} else {
// 过滤掉非标量数据
unset($data[$key]);
}
}
$value = array_values($data);