diff --git a/library/think/db/Query.php b/library/think/db/Query.php index 64a446a4..0df53610 100644 --- a/library/think/db/Query.php +++ b/library/think/db/Query.php @@ -635,6 +635,7 @@ class Query $this->options = []; return true; } + return $this->setField($field, ['inc', $field, $step]); } return $this->setField($field, ['dec', $field, $step]); } diff --git a/library/think/model/relation/BelongsToMany.php b/library/think/model/relation/BelongsToMany.php index f9d69099..13a8018d 100644 --- a/library/think/model/relation/BelongsToMany.php +++ b/library/think/model/relation/BelongsToMany.php @@ -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); } }