wzq 5 년 전
부모
커밋
9a6fe476a8
2개의 변경된 파일4개의 추가작업 그리고 4개의 파일을 삭제
  1. 2 2
      app/Console/Commands/UpdatePostInfo.php
  2. 2 2
      app/Console/Commands/UpdatePostStatus.php

+ 2 - 2
app/Console/Commands/UpdatePostInfo.php

@@ -48,8 +48,8 @@ class UpdatePostInfo extends Command
     {
         $this->line("开始更新内容信息");
 
-        $bar = $this->output->createProgressBar($this->post->count());
-        $this->post->chunk(100, function($posts) use ($bar){
+        $bar = $this->output->createProgressBar($this->post->withTrashed()->count());
+        $this->post->withTrashed()->chunk(100, function($posts) use ($bar){
             foreach($posts as $post){
                 $bar->advance();
                 if(!$post->data) continue;

+ 2 - 2
app/Console/Commands/UpdatePostStatus.php

@@ -57,8 +57,8 @@ class UpdatePostStatus extends Command
     {
         $this->line("开始更新内容用户状态");
 
-        $bar = $this->output->createProgressBar($this->post->count());
-        $this->post->chunk(100, function($posts) use ($bar){
+        $bar = $this->output->createProgressBar($this->post->withTrashed()->count());
+        $this->post->withTrashed()->chunk(100, function($posts) use ($bar){
             foreach($posts as $post) {
                 //点赞
                 $likeUid = $this->postLike->where('post_id', $post->id)->pluck('uid')->toArray();