Ver código fonte

Merge branch 'master' into release

wzq 5 anos atrás
pai
commit
d8396526a5

+ 2 - 1
.rocketeer/hooks.php

@@ -28,7 +28,8 @@ return [
             'composer dumpautoload',
             'chmod -R 777 bootstrap',
             'chmod -R 777 storage',
-            'chmod -R 777 public'
+            'chmod -R 777 public',
+            'service php-fpm reload'
         ],
         'cleanup' => [],
     ],

+ 8 - 4
app/Repositories/CmsContentTemplateRepository.php

@@ -8,6 +8,7 @@ use App\Models\CmsContentTemplateSet;
 use Illuminate\Support\Facades\Cache;
 use Illuminate\Support\Facades\Log;
 use Symfony\Component\HttpKernel\Exception\HttpException;
+use Illuminate\Support\Facades\Redis;
 
 class CmsContentTemplateRepository {
     public function __construct(CmsContentTemplate $cmsContentTemplate) {
@@ -108,12 +109,15 @@ class CmsContentTemplateRepository {
             throw new HttpException(500, '修改状态失败');
         }
         if ($template_id->apply_type == 0){
-            if (Cache::has($group_key)) {
-                Cache::forget($group_key);
+//            if (Cache::has($group_key)) {
+//                Cache::forget($group_key);
+//            }
+            if (Redis::exists($group_key)) {
+                Redis::del($group_key);
             }
         }elseif ($template_id->apply_type == 1){
-            if (Cache::has($market_key)) {
-                Cache::forget($market_key);
+            if (Redis::exists($market_key)) {
+                Redis::del($market_key);
             }
         }
 

+ 10 - 6
app/Repositories/CmsContentTemplateSetRepository.php

@@ -8,6 +8,7 @@ use App\Models\CmsContentTemplate;
 use App\Models\CmsContentTemplateSet;
 use App\Models\CmsSubjectProduct;
 use Illuminate\Support\Facades\Cache;
+use Illuminate\Support\Facades\Redis;
 use Symfony\Component\HttpKernel\Exception\HttpException;
 use Illuminate\Support\Facades\DB;
 use Illuminate\Database\QueryException;
@@ -472,16 +473,19 @@ class CmsContentTemplateSetRepository
             }
         }
         if ($template->apply_type == 0) {
-            if (Cache::has($group_key)) {
-                Cache::forget($group_key);
+//            if (Cache::has($group_key)) {
+//                Cache::forget($group_key);
+//            }
+            if (Redis::exists($group_key)) {
+                Redis::del($group_key);
             }
         } elseif ($template->apply_type == 1) {
-            if (Cache::has($market_key)) {
-                Cache::forget($market_key);
+            if (Redis::exists($market_key)) {
+                Redis::del($market_key);
             }
         } elseif ($template->apply_type == 2) {
-            if (Cache::has($exchange_key)) {
-                Cache::forget($exchange_key);
+            if (Redis::exists($exchange_key)) {
+                Redis::del($exchange_key);
             }
         }