mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-10 00:22:48 +08:00
改进Query类with方法
This commit is contained in:
@@ -1895,7 +1895,7 @@ class Query
|
|||||||
$relation = Loader::parseName($relation, 1, false);
|
$relation = Loader::parseName($relation, 1, false);
|
||||||
$model = $class->$relation();
|
$model = $class->$relation();
|
||||||
if ($model instanceof OneToOne && 0 == $model->getEagerlyType()) {
|
if ($model instanceof OneToOne && 0 == $model->getEagerlyType()) {
|
||||||
$model->eagerly($this, $relation, $subRelation, $closure, $first);
|
$model->removeOption()->eagerly($this, $relation, $subRelation, $closure, $first);
|
||||||
$first = false;
|
$first = false;
|
||||||
} elseif ($closure) {
|
} elseif ($closure) {
|
||||||
$with[$key] = $closure;
|
$with[$key] = $closure;
|
||||||
|
|||||||
@@ -194,9 +194,6 @@ abstract class OneToOne extends Relation
|
|||||||
*/
|
*/
|
||||||
public function getEagerlyType()
|
public function getEagerlyType()
|
||||||
{
|
{
|
||||||
if (0 == $this->eagerlyType) {
|
|
||||||
$this->removeOption();
|
|
||||||
}
|
|
||||||
return $this->eagerlyType;
|
return $this->eagerlyType;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user