This commit is contained in:
thinkphp
2018-01-24 19:15:01 +08:00
parent 09f031b371
commit 554817c045

View File

@@ -50,8 +50,8 @@ class MorphTo extends Relation
*/ */
public function getModel() public function getModel()
{ {
$morphKey = $this->morphKey; $morphType = $this->morphType;
$model = $this->parseModel($this->parent->$morphType); $model = $this->parseModel($this->parent->$morphType);
return (new $model)->db()->getModel(); return (new $model)->db()->getModel();
} }