/** * decr * * @param string $key */ public function decrement($key, $step = 1) { if ($step == 1) { return $this->redis->decr($key); } else { return $this->redis->decrBy($key, $step); } }
/** * 数据自减 * * @access public * * @param string $key 数据key * @param integer $value 自减数据值 * * @return boolean */ public function decrement($key, $value = 1) { //参数分析 if (!$key) { return false; } return $this->_Redis->decrBy($key, $value); }