改进一对一关联预载入查询

This commit is contained in:
thinkphp
2018-02-08 17:27:26 +08:00
parent b052eccb26
commit f80073f9f9

View File

@@ -304,6 +304,8 @@ abstract class OneToOne extends Relation
*/
protected function eagerlyWhere($model, $where, $key, $relation, $subRelation = '', $closure = false)
{
$this->baseQuery = true;
// 预载入关联查询 支持嵌套预载入
if ($closure) {
call_user_func_array($closure, [ & $model]);