diff --git a/library/think/db/Connection.php b/library/think/db/Connection.php index a45d8d3e..2e716b29 100644 --- a/library/think/db/Connection.php +++ b/library/think/db/Connection.php @@ -284,7 +284,7 @@ abstract class Connection if ($this->linkID) { return $this->linkID->getAttribute(PDO::ATTR_DRIVER_NAME); } else { - return basename(str_replace('\\', '/', $this->config['type'])); + return $this->config['type']; } } diff --git a/library/think/db/Query.php b/library/think/db/Query.php index f380b563..3018e48e 100644 --- a/library/think/db/Query.php +++ b/library/think/db/Query.php @@ -359,7 +359,7 @@ class Query static $builder = []; $driver = $this->driver; if (!isset($builder[$driver])) { - $class = '\\think\\db\\builder\\' . ucfirst($driver); + $class = false !== strpos($driver, '\\') ? $driver : '\\think\\db\\builder\\' . ucfirst($driver); $builder[$driver] = new $class($this->connection); } // 设置当前查询对象