mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-10 00:22:48 +08:00
改进Relation类的getRelation方法 支持在关联定义方法中使用where条件或者其他的操作Query操作方法
This commit is contained in:
@@ -78,7 +78,7 @@ class Relation
|
||||
$relation = $this->parent->$name();
|
||||
$foreignKey = $this->foreignKey;
|
||||
$localKey = $this->localKey;
|
||||
if ($relation instanceof Relation) {
|
||||
|
||||
// 判断关联类型执行查询
|
||||
switch ($this->type) {
|
||||
case self::HAS_ONE:
|
||||
@@ -117,9 +117,6 @@ class Relation
|
||||
$result = $relation;
|
||||
}
|
||||
return $result;
|
||||
} else {
|
||||
return $relation;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user