改进Query类的driver属性设置 删除Connection类的getDriverName方法 改进connect方法

This commit is contained in:
thinkphp
2016-08-02 15:38:58 +08:00
parent 731d0c0002
commit 17c76a41c7
2 changed files with 12 additions and 21 deletions

View File

@@ -59,7 +59,7 @@ class Query
public function __construct(Connection $connection = null, $model = '')
{
$this->connection = $connection ?: Db::connect([], true);
$this->driver = $this->connection->getDriverName();
$this->driver = $this->connection->getConfig('type');
$this->prefix = $this->connection->getConfig('prefix');
$this->model = $model;
}