From 46a0af7723a13b83cf016db90d95e1f43c17d535 Mon Sep 17 00:00:00 2001 From: thinkphp Date: Wed, 17 Aug 2016 16:50:44 +0800 Subject: [PATCH] =?UTF-8?q?Cache=E7=B1=BB=E7=9A=84tag=E6=96=B9=E6=B3=95?= =?UTF-8?q?=E6=94=AF=E6=8C=81=E8=BF=BD=E5=8A=A0=E7=BC=93=E5=AD=98=E6=A0=87?= =?UTF-8?q?=E8=AF=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/think/cache/Driver.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/library/think/cache/Driver.php b/library/think/cache/Driver.php index e1b4bcbd..84ce7eaf 100644 --- a/library/think/cache/Driver.php +++ b/library/think/cache/Driver.php @@ -93,9 +93,12 @@ abstract class Driver $this->tag = $name; return $this; } else { - $key = 'tag_' . md5($name); - $value = is_array($keys) ? implode(',', $keys) : $keys; - $this->set($key, $value); + $key = 'tag_' . md5($name); + if (is_string($keys)) { + $keys = explode(',', $keys); + } + $value = array_unique(array_merge($this->getTagItem($name), $keys)); + $this->set($key, implode(',', $value)); } }