|
@@ -164,7 +164,7 @@ class CacheRedis extends Cache
|
|
|
$value[1] = str_replace(' ', '', $value[1]);
|
|
|
preg_match('/^[A-Za-z_]+([+-]\d+(\.\d+)?)$/',$value[1],$matches);
|
|
|
if (is_numeric($matches[1])) {
|
|
|
- $this->hIncrBy($name, $prefix, $key, $matches[1]);
|
|
|
+ $this->hIncrByFloat($name, $prefix, $key, $matches[1]);
|
|
|
}
|
|
|
unset($data[$key]);
|
|
|
}
|
|
@@ -210,7 +210,15 @@ class CacheRedis extends Cache
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- public function hIncrBy($name, $prefix, $key, $num = 1) {
|
|
|
+ public function hIncrBy($name, $key, $value)
|
|
|
+ {
|
|
|
+ $this->init_master();
|
|
|
+ if (!$this->enable) return false;
|
|
|
+
|
|
|
+ return $this->handler->hIncrBy($this->_key($name), $key, $value);
|
|
|
+ }
|
|
|
+
|
|
|
+ public function hIncrByFloat($name, $prefix, $key, $num = 1) {
|
|
|
if ($this->hget($name, $prefix,$key) !== false) {
|
|
|
$this->handler->hIncrByFloat($this->_key($name), $key, floatval($num));
|
|
|
}
|