修正写入数据的参数绑定

This commit is contained in:
thinkphp
2016-04-23 09:03:41 +08:00
parent e4eaf89854
commit 138dab1e9e

View File

@@ -100,9 +100,14 @@ abstract class Builder
$result[$item] = 'NULL'; $result[$item] = 'NULL';
} elseif (is_scalar($val)) { } elseif (is_scalar($val)) {
// 过滤非标量数据 // 过滤非标量数据
if ($this->query->isBind(substr($val, 1))) {
$result[$item] = $val;
} else {
$this->query->bind($key, $val, isset($bind[$key]) ? $bind[$key] : PDO::PARAM_STR); $this->query->bind($key, $val, isset($bind[$key]) ? $bind[$key] : PDO::PARAM_STR);
$result[$item] = ':' . $key; $result[$item] = ':' . $key;
} }
}
} }
} }
return $result; return $result;