This commit is contained in:
thinkphp
2017-03-21 14:29:33 +08:00
parent af6dc8c3f3
commit f5f39422e2
2 changed files with 2 additions and 2 deletions

View File

@@ -113,7 +113,7 @@ class Memcache extends Driver
public function inc($name, $step = 1) public function inc($name, $step = 1)
{ {
$key = $this->getCacheKey($name); $key = $this->getCacheKey($name);
if( $this->has($name) ){ if ($this->handler->get($key)) {
return $this->handler->increment($key, $step); return $this->handler->increment($key, $step);
} }
return $this->handler->set($key, $step); return $this->handler->set($key, $step);

View File

@@ -125,7 +125,7 @@ class Memcached extends Driver
public function inc($name, $step = 1) public function inc($name, $step = 1)
{ {
$key = $this->getCacheKey($name); $key = $this->getCacheKey($name);
if( $this->has($name) ){ if ($this->handler->get($key)) {
return $this->handler->increment($key, $step); return $this->handler->increment($key, $step);
} }
return $this->handler->set($key, $step); return $this->handler->set($key, $step);