数据库查询的数据集类型设置改为字符串

This commit is contained in:
thinkphp
2016-06-14 14:06:40 +08:00
parent fb188291d5
commit c9155c016d
2 changed files with 3 additions and 11 deletions

View File

@@ -50,7 +50,7 @@ abstract class Connection
protected $linkWrite;
// 查询结果类型
protected $resultSetType = Db::RESULTSET_ARRAY;
protected $resultSetType = 'array';
// 查询结果类型
protected $fetchType = PDO::FETCH_ASSOC;
// 字段属性大小写
@@ -485,13 +485,11 @@ abstract class Connection
return new $class($result);
}
switch ($this->resultSetType) {
case Db::RESULTSET_COLLECTION:
case 'collection':
// 返回数据集Collection对象
$result = new Collection($result);
break;
case Db::RESULTSET_CLASS:
break;
case Db::RESULTSET_ARRAY:
case 'array':
default:
// 返回二维数组
}