소스 검색

Update FixHashtags command

Daniel Supernault 6 년 전
부모
커밋
cec1c118d5
1개의 변경된 파일2개의 추가작업 그리고 2개의 파일을 삭제
  1. 2 2
      app/Console/Commands/FixHashtags.php

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

@@ -56,13 +56,13 @@ class FixHashtags extends Command
         $this->info('Running Fix Hashtags command');
         $this->info(' ');
 
-        $missingCount = StatusHashtag::doesntHave('status')->count();
+        $missingCount = StatusHashtag::doesntHave('profile')->doesntHave('status')->count();
         if($missingCount > 0) {
             $this->info("Found {$missingCount} orphaned StatusHashtag records to delete ...");
             $this->info(' ');
             $bar = $this->output->createProgressBar($missingCount);
             $bar->start();
-            foreach(StatusHashtag::doesntHave('status')->get() as $tag) {
+            foreach(StatusHashtag::doesntHave('profile')->doesntHave('status')->get() as $tag) {
                 $tag->delete();
                 $bar->advance();
             }