修正预载入方法 并支持 find和select

This commit is contained in:
thinkphp
2016-04-12 17:17:02 +08:00
parent c5cf46c392
commit f571555320
2 changed files with 107 additions and 11 deletions

View File

@@ -2016,7 +2016,7 @@ abstract class Driver
if (!empty($options['with'])) {
// 预载入
$result = new $options['model']();
return $result->eagerly($resultSet, $options['with']);
return $result->eagerlyResultSet($resultSet, $options['with']);
}
}
}
@@ -2123,6 +2123,10 @@ abstract class Driver
if (!empty($options['relation'])) {
$data->relationQuery($options['relation']);
}
if (!empty($options['with'])) {
// 预载入
$data->eagerlyResult($data, $options['with']);
}
}
} else {
$data = false;