MyQEE\Server\Table::incr PHP Method

incr() public method

原子自增操作,可用于整形或浮点型列
public incr ( $key, $column, $incrby = 1 ) : boolean | integer
$key
$column
$incrby
return boolean | integer
    function incr($key, $column, $incrby = 1)
    {
        if ($this->_link) {
            $rs = parent::incr($key, $column, $incrby);
            if (false === $rs) {
                return false;
            }
            if (false === $this->_driverSet($key, [$column => $rs])) {
                # 重试
                usleep(300);
                $this->_driverSet($key, [$column => $rs]);
            }
            return $rs;
        } else {
            return parent::incr($key, $column, $incrby);
        }
    }