wzq %!s(int64=5) %!d(string=hai) anos
pai
achega
14fdd8321e
Modificáronse 1 ficheiros con 2 adicións e 2 borrados
  1. 2 2
      app/Transformers/Post/SuggestTransformer.php

+ 2 - 2
app/Transformers/Post/SuggestTransformer.php

@@ -33,7 +33,6 @@ class SuggestTransformer extends TransformerAbstract
         $comment = [];
         $commentKey = 'post_new_comment_'.$post['id'];
         $commentData = Redis::GET($commentKey);
-        Redis::del($commentKey);
         if($commentData){
             $comment = json_decode($commentData);
         }else{
@@ -46,7 +45,8 @@ class SuggestTransformer extends TransformerAbstract
                     'content' => $item->is_delete?'该评论已被删除':$item->content,
                 ];
             }
-//            Redis::SET($commentKey, json_encode($comment));
+            Redis::SET($commentKey, json_encode($comment));
+            Redis::EXPIRE($commentKey, 300);
         }
 
         $isLike = 0;