diff --git a/library/think/View.php b/library/think/View.php index eb6ff3cb..c763c688 100644 --- a/library/think/View.php +++ b/library/think/View.php @@ -178,11 +178,6 @@ class View $replace = $this->config['parse_str']; $content = str_replace(array_keys($replace), array_values($replace), $content); } - if (APP_DEBUG && $this->config['parse_var']) { - // debug模式时,将后台分配变量输出到浏览器控制台 - $parseVar = empty($vars) ? json_encode([]) : json_encode($vars); - $content .= ''; - } return $content; } diff --git a/library/think/db/Driver.php b/library/think/db/Driver.php index ba68ad96..02ff2e72 100644 --- a/library/think/db/Driver.php +++ b/library/think/db/Driver.php @@ -432,8 +432,8 @@ abstract class Driver $set[] = $this->parseKey($key) . '=' . $val; } else { $name = count($this->bind); - $set[] = $this->parseKey($key) . '=:' . $name; - $this->bindParam($name, $val); + $set[] = $this->parseKey($key) . '=:' . $key . '_' . $name; + $this->bindParam($key . '_' . $name, $val); } } } @@ -458,7 +458,7 @@ abstract class Driver * @param string $key * @return string */ - protected function parseKey(&$key) + protected function parseKey($key) { return $key; } @@ -539,8 +539,7 @@ abstract class Driver } $tables = $array; } elseif (is_string($tables)) { - $tables = explode(',', $tables); - array_walk($tables, [ & $this, 'parseKey']); + $tables = array_map([$this, 'parseKey'], explode(',', $tables)); } return implode(',', $tables); } @@ -913,8 +912,8 @@ abstract class Driver $values[] = $val; } else { $name = count($this->bind); - $values[] = ':' . $name; - $this->bindParam($name, $val); + $values[] = ':' . $key . '_' . $name; + $this->bindParam($key . '_' . $name, $val); } } } @@ -983,8 +982,8 @@ abstract class Driver $fields = explode(',', $fields); } - array_walk($fields, [$this, 'parseKey']); - $sql = 'INSERT INTO ' . $this->parseTable($table) . ' (' . implode(',', $fields) . ') '; + $fields = array_map([$this, 'parseKey'], $fields); + $sql = 'INSERT INTO ' . $this->parseTable($table) . ' (' . implode(',', $fields) . ') '; $sql .= $this->buildSelectSql($options); return $this->execute($sql, !empty($options['fetch_sql']) ? true : false); } diff --git a/library/think/db/driver/Mysql.php b/library/think/db/driver/Mysql.php index 6f2ba59c..9bde9fdb 100644 --- a/library/think/db/driver/Mysql.php +++ b/library/think/db/driver/Mysql.php @@ -90,7 +90,7 @@ class Mysql extends Driver * @param string $key * @return string */ - protected function parseKey(&$key) + protected function parseKey($key) { $key = trim($key); if (strpos($key, '$.') && false === strpos($key, '(')) { diff --git a/library/think/db/driver/Oracle.php b/library/think/db/driver/Oracle.php index 0efc1ebc..5478a342 100644 --- a/library/think/db/driver/Oracle.php +++ b/library/think/db/driver/Oracle.php @@ -179,7 +179,7 @@ class Oracle extends Driver * @param string $key * @return string */ - protected function parseKey(&$key) + protected function parseKey($key) { $key = trim($key); if (strpos($key, '$.') && false === strpos($key, '(')) { diff --git a/library/think/db/driver/Pgsql.php b/library/think/db/driver/Pgsql.php index 25e9f1a1..961eb17a 100644 --- a/library/think/db/driver/Pgsql.php +++ b/library/think/db/driver/Pgsql.php @@ -100,7 +100,7 @@ class Pgsql extends Driver * @param string $key * @return string */ - protected function parseKey(&$key) + protected function parseKey($key) { $key = trim($key); if (strpos($key, '$.') && false === strpos($key, '(')) { diff --git a/library/think/db/driver/Sqlsrv.php b/library/think/db/driver/Sqlsrv.php index f6d17177..470f5dac 100644 --- a/library/think/db/driver/Sqlsrv.php +++ b/library/think/db/driver/Sqlsrv.php @@ -108,7 +108,7 @@ class Sqlsrv extends Driver * @param string $key * @return string */ - protected function parseKey(&$key) + protected function parseKey($key) { $key = trim($key); if (!preg_match('/[,\'\"\*\(\)\[.\s]/', $key)) {