igb пре 6 месеци
родитељ
комит
b020be0a3e
1 измењених фајлова са 15 додато и 1 уклоњено
  1. 15 1
      app/Helpers/SiteCache.php

+ 15 - 1
app/Helpers/SiteCache.php

@@ -155,7 +155,21 @@ class SiteCache
      */
     public static function clearSpecificTypeCache(string $domain, string $type): void
     {
-        Cache::tags([$domain, $type])->flush(); // 清除该域名下特定类型的缓存
+        //找出域名下的所有域名后再清除缓存
+
+        if(!empty($domain)) {
+
+            $dist= DistAdminDistributor::findByDomain($domain);
+
+            if($dist?->secondary_domain) {
+                Cache::tags([$dist?->secondary_domain, $type])->flush(); // 清除该域名下特定类型的缓存
+            }
+
+            if($dist?->custom_domain) {
+                Cache::tags([$dist?->custom_domain, $type])->flush(); // 清除该域名下特定类型的缓存
+            }
+
+        }
     }