diff --git a/library/think/cache/driver/Memcache.php b/library/think/cache/driver/Memcache.php index 1fbd3b08..b4295e56 100644 --- a/library/think/cache/driver/Memcache.php +++ b/library/think/cache/driver/Memcache.php @@ -113,7 +113,10 @@ class Memcache extends Driver public function inc($name, $step = 1) { $key = $this->getCacheKey($name); - return $this->handler->increment($key, $step); + if( $this->has($name) ){ + return $this->handler->increment($key, $step); + } + return $this->handler->set($key, $step); } /**