getCacheClient()->keys($this->getPrefix() . $key . '*'); } public function getCacheKeysAll($key) { return $this->getCacheClient()->keys('*' . $key . '*'); } /** * 模糊清除所有前缀的缓存 * @param $key */ public function removeByKey($key) { $list = $this->getCacheKeysAll($key); foreach ($list as $item) { $this->getCacheClient()->del($item); } } }