Преглед на файлове

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('Running Fix Hashtags command');
         $this->info(' ');
         $this->info(' ');
 
 
-        $missingCount = StatusHashtag::doesntHave('status')->count();
+        $missingCount = StatusHashtag::doesntHave('profile')->doesntHave('status')->count();
         if($missingCount > 0) {
         if($missingCount > 0) {
             $this->info("Found {$missingCount} orphaned StatusHashtag records to delete ...");
             $this->info("Found {$missingCount} orphaned StatusHashtag records to delete ...");
             $this->info(' ');
             $this->info(' ');
             $bar = $this->output->createProgressBar($missingCount);
             $bar = $this->output->createProgressBar($missingCount);
             $bar->start();
             $bar->start();
-            foreach(StatusHashtag::doesntHave('status')->get() as $tag) {
+            foreach(StatusHashtag::doesntHave('profile')->doesntHave('status')->get() as $tag) {
                 $tag->delete();
                 $tag->delete();
                 $bar->advance();
                 $bar->advance();
             }
             }