mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-08 15:42:48 +08:00
改进Relation类的getRelation方法 支持在关联定义方法中使用where条件或者其他的操作Query操作方法
This commit is contained in:
@@ -78,7 +78,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:
|
||||||
@@ -117,9 +117,6 @@ class Relation
|
|||||||
$result = $relation;
|
$result = $relation;
|
||||||
}
|
}
|
||||||
return $result;
|
return $result;
|
||||||
} else {
|
|
||||||
return $relation;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user