wzq hace 5 años
padre
commit
5d832b9f6f
Se han modificado 1 ficheros con 5 adiciones y 2 borrados
  1. 5 2
      app/Console/Commands/UpdateReplyCount.php

+ 5 - 2
app/Console/Commands/UpdateReplyCount.php

@@ -47,12 +47,15 @@ class UpdateReplyCount extends Command
     public function handle()
     {
         $this->line("开始更新评论回复数量");
-        
+
+        $bar = $this->output->createProgressBar($this->postComment->where('parent_id', 0)->count()+1000);
+
         for($i=1;$i<1000;$i++){
             Redis::del('post_new_comment_'.$i);
+            Redis::del('post_new_reply_'.$i);
+            $bar->advance();
         }
 
-        $bar = $this->output->createProgressBar($this->postComment->where('parent_id', 0)->count());
         $this->postComment->where('parent_id', 0)->chunk(100, function($comments) use ($bar){
             foreach($comments as $comment){
                 $replyCount = $this->postComment->where('parent_id', $comment->id)->count();