wesmiler 1 天之前
父節點
當前提交
fb338ca418
共有 2 個文件被更改,包括 3 次插入2 次删除
  1. 1 0
      app/Http/Controllers/Admin/IndexController.php
  2. 2 2
      app/Services/Api/NoticeService.php

+ 1 - 0
app/Http/Controllers/Admin/IndexController.php

@@ -105,6 +105,7 @@ class IndexController extends Backend
         RedisService::keyDel("caches:account*");
         RedisService::keyDel("caches:article*");
         RedisService::keyDel("caches:social*");
+        RedisService::keyDel("caches:notices*");
         RedisService::keyDel("caches:member*");
         RedisService::keyDel("caches:config*");
         RedisService::keyDel("caches:stores*");

+ 2 - 2
app/Services/Api/NoticeService.php

@@ -56,7 +56,7 @@ class NoticeService extends BaseService
      */
     public function getDataList($num = 30, $type=2)
     {
-        $cacheKey = "caches:index:notices_{$type}";
+        $cacheKey = "caches:notices:index_{$type}";
         $datas = RedisService::get($cacheKey);
         if($datas){
             return $datas;
@@ -82,7 +82,7 @@ class NoticeService extends BaseService
      */
     public function updateOrderNotice($title, $content, $type = 2)
     {
-        RedisService::clear("caches:index:notices_{$type}");
+        RedisService::clear("caches:notices:index_{$type}");
         $this->model->where(['type'=>2])->where('create_time','<=', time() - 7 * 86400)->delete();
         return $this->model->insertGetId(['title'=>$title,'content'=>$content,'type'=>2,'status'=>1,'create_time'=>time()]);
     }