mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-08 23:52:49 +08:00
改进Relation类
This commit is contained in:
@@ -72,6 +72,7 @@ class Relation
|
|||||||
$relation = $this->parent->$name();
|
$relation = $this->parent->$name();
|
||||||
$foreignKey = $this->foreignKey;
|
$foreignKey = $this->foreignKey;
|
||||||
$localKey = $this->localKey;
|
$localKey = $this->localKey;
|
||||||
|
if ($relation instanceof Relation) {
|
||||||
// 判断关联类型执行查询
|
// 判断关联类型执行查询
|
||||||
switch ($this->type) {
|
switch ($this->type) {
|
||||||
case self::HAS_ONE:
|
case self::HAS_ONE:
|
||||||
@@ -107,6 +108,9 @@ class Relation
|
|||||||
$result = $relation;
|
$result = $relation;
|
||||||
}
|
}
|
||||||
return $result;
|
return $result;
|
||||||
|
} else {
|
||||||
|
return $relation;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user