mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-01 12:42:48 +08:00
改进parseData方法的对象处理参数绑定
This commit is contained in:
@@ -98,15 +98,16 @@ abstract class Builder
|
||||
$result = [];
|
||||
foreach ($data as $key => $val) {
|
||||
$item = $this->parseKey($key, $options);
|
||||
if (is_object($val) && method_exists($val, '__toString')) {
|
||||
// 对象数据写入
|
||||
$val = $val->__toString();
|
||||
}
|
||||
if (false === strpos($key, '.') && !in_array($key, $fields, true)) {
|
||||
if ($options['strict']) {
|
||||
throw new Exception('fields not exists:[' . $key . ']');
|
||||
}
|
||||
} elseif (is_null($val)) {
|
||||
$result[$item] = 'NULL';
|
||||
} elseif (is_object($val) && method_exists($val, '__toString')) {
|
||||
// 对象数据写入
|
||||
$result[$item] = $val->__toString();
|
||||
} elseif (isset($val[0]) && 'exp' == $val[0]) {
|
||||
$result[$item] = $val[1];
|
||||
} elseif (is_scalar($val)) {
|
||||
|
||||
Reference in New Issue
Block a user