Skip to content
Permalink
Browse files

改进inc和dec查询

  • Loading branch information...
liu21st committed Mar 26, 2018
1 parent a9546e7 commit 363fd4d90312f2cfa427535b7ea01a097ca8db1b
Showing with 6 additions and 2 deletions.
  1. +6 −2 library/think/db/Builder.php
@@ -116,10 +116,14 @@ protected function parseData($data, $options)
$result[$item] = $val[1];
break;
case 'inc':
$result[$item] = $this->parseKey($val[1]) . '+' . floatval($val[2]);
if ($key == $val[1]) {
$result[$item] = $this->parseKey($val[1]) . '+' . floatval($val[2]);
}
break;
case 'dec':
$result[$item] = $this->parseKey($val[1]) . '-' . floatval($val[2]);
if ($key == $val[1]) {
$result[$item] = $this->parseKey($val[1]) . '-' . floatval($val[2]);
}
break;
}
} elseif (is_scalar($val)) {

0 comments on commit 363fd4d

Please sign in to comment.
You can’t perform that action at this time.