mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-01 12:42:48 +08:00
修正MorphTo关联
This commit is contained in:
@@ -43,6 +43,18 @@ class MorphTo extends Relation
|
|||||||
$this->relation = $relation;
|
$this->relation = $relation;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取当前的关联模型类的实例
|
||||||
|
* @access public
|
||||||
|
* @return Model
|
||||||
|
*/
|
||||||
|
public function getModel()
|
||||||
|
{
|
||||||
|
$morphKey = $this->morphKey;
|
||||||
|
$model = $this->parseModel($this->parent->$morphType);
|
||||||
|
return (new $model)->db()->getModel();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 延迟获取关联数据
|
* 延迟获取关联数据
|
||||||
* @param string $subRelation 子关联名
|
* @param string $subRelation 子关联名
|
||||||
|
|||||||
Reference in New Issue
Block a user