Think/Model.php
public function setInc($field, $step = 1, $lazyTime = 0)
    {
        // 延迟写入
        if ($lazyTime > 0) {
            $condition = $this->options['where'];
            $guid = md5($this->name.'_'.$field.'_'.serialize($condition));
            $step = $this->lazyWrite($guid, $step, $lazyTime);
            if (empty($step)) {
                // 等待下次写入
                return true;
            } elseif ($step < 0) {
                $step = '-'.$step;
            }
        }

        return $this->setField($field, ['exp', '`'.$field.'`+'.$step]);
    }
public function setInc($field, $step = 1, $lazyTime = 0)
    {
        // 延迟写入
        if ($lazyTime > 0) {
            $condition = $this->options['where'];
            $guid = md5($this->name.'_'.$field.'_'.serialize($condition));
            $step = $this->lazyWrite($guid, $step, $lazyTime);
            if (empty($step)) {
                // 等待下次写入
                return true;
            } elseif ($step < 0) {
                $step = '-'.$step;
            }
        }

        return $this->setField($field, ['exp', '`'.$field.'`+'.$step]);
    }
字段值增长
@param string $field 字段名
@param int $step 增长值
@param int $lazyTime 延时时间(s)

@return bool