修正setDec方法的延迟写入

This commit is contained in:
thinkphp
2017-12-13 17:54:53 +08:00
parent 924d78d5f7
commit 0c61269bcf
2 changed files with 2 additions and 1 deletions

View File

@@ -53,7 +53,7 @@ class BelongsToMany extends Relation
$this->query = (new $model)->db();
$this->pivot = $this->newPivot();
if (!is_subclass_of($this->pivot, '\\think\\model\\Pivot')) {
if ('think\model\Pivot' == get_class($this->pivot)) {
$this->pivot->name($this->middle);
}
}