This commit is contained in:
thinkphp
2017-10-23 11:52:30 +08:00
parent 4d131bb3e5
commit ba9efa867f
2 changed files with 3 additions and 3 deletions

View File

@@ -248,7 +248,7 @@ class MorphTo extends Relation
$pk = $model->getPk();
$this->parent->setAttr($morphKey, $model->$pk);
$this->parent->setAttr($morphType, basename(get_class($model)));
$this->parent->setAttr($morphType, get_class($model));
$this->parent->save();
return $this->parent->setRelation($this->relation, $model);