改进Connection类的getRealSql方法

This commit is contained in:
thinkphp
2017-09-14 18:29:22 +08:00
parent c7ee078c23
commit 8d39aa9b05

View File

@@ -478,8 +478,8 @@ abstract class Connection
$sql = is_numeric($key) ?
substr_replace($sql, $value, strpos($sql, '?'), 1) :
str_replace(
[':' . $key . ')', ':' . $key . ',', ':' . $key . ' '],
[$value . ')', $value . ',', $value . ' '],
[':' . $key . ')', ':' . $key . ',', ':' . $key . ' ', ':' . $key . PHP_EOL],
[$value . ')', $value . ',', $value . ' ', $value . PHP_EOL],
$sql . ' ');
}
return rtrim($sql);