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