From 0c61269bcfdabfe654d277525ce684fd637f64a4 Mon Sep 17 00:00:00 2001 From: thinkphp Date: Wed, 13 Dec 2017 17:54:53 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3setDec=E6=96=B9=E6=B3=95?= =?UTF-8?q?=E7=9A=84=E5=BB=B6=E8=BF=9F=E5=86=99=E5=85=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/think/db/Query.php | 1 + library/think/model/relation/BelongsToMany.php | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) 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); } }