改进Model类toCollection方法

This commit is contained in:
thinkphp
2017-01-22 13:45:54 +08:00
parent 6f02e4b127
commit 1b17858887

View File

@@ -654,7 +654,7 @@ abstract class Model implements \JsonSerializable, \ArrayAccess
if ($this->resultSetType) {
if ('collection' == $this->resultSetType) {
$collection = new Collection($collection);
} else {
} elseif (false !== strpos($this->resultSetType, '\\')) {
$class = $this->resultSetType;
$collection = new $class($collection);
}