修正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

@@ -635,6 +635,7 @@ class Query
$this->options = []; $this->options = [];
return true; return true;
} }
return $this->setField($field, ['inc', $field, $step]);
} }
return $this->setField($field, ['dec', $field, $step]); return $this->setField($field, ['dec', $field, $step]);
} }

View File

@@ -53,7 +53,7 @@ class BelongsToMany extends Relation
$this->query = (new $model)->db(); $this->query = (new $model)->db();
$this->pivot = $this->newPivot(); $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); $this->pivot->name($this->middle);
} }
} }