修正Query类的inc和dec方法的关键词问题

This commit is contained in:
thinkphp
2017-12-11 21:53:27 +08:00
parent 1fba8e32d4
commit 6356cacefd
2 changed files with 16 additions and 6 deletions

View File

@@ -607,7 +607,7 @@ class Query
return true;
}
}
return $this->setField($field, ['exp', $field . '+' . $step]);
return $this->setField($field, ['inc', $field, $step]);
}
/**
@@ -636,7 +636,7 @@ class Query
return true;
}
}
return $this->setField($field, ['exp', $field . '-' . $step]);
return $this->setField($field, ['dec', $field, $step]);
}
/**
@@ -829,7 +829,7 @@ class Query
{
$fields = is_string($field) ? explode(',', $field) : $field;
foreach ($fields as $field) {
$this->data($field, ['exp', $field . '+' . $step]);
$this->data($field, ['inc', $field, $step]);
}
return $this;
}
@@ -845,7 +845,7 @@ class Query
{
$fields = is_string($field) ? explode(',', $field) : $field;
foreach ($fields as $field) {
$this->data($field, ['exp', $field . '-' . $step]);
$this->data($field, ['dec', $field, $step]);
}
return $this;
}