Przeglądaj źródła

只输出公开channel

visuddhinanda 2 lat temu
rodzic
commit
5104b25388
1 zmienionych plików z 7 dodań i 3 usunięć
  1. 7 3
      app/Console/Commands/ExportChapterIndex.php

+ 7 - 3
app/Console/Commands/ExportChapterIndex.php

@@ -54,9 +54,13 @@ class ExportChapterIndex extends Command
             return 1;
         }
 
-        $bar = $this->output->createProgressBar(ProgressChapter::count());
-        foreach (ProgressChapter::select(['uid','book','para',
-                    'lang','title','channel_id','progress','updated_at'])->cursor() as $row) {
+        $publicChannels = Channel::where('status',30)->select('uid')->get();
+
+        $bar = $this->output->createProgressBar(ProgressChapter::whereIn('channel_id',$publicChannels)->count());
+        foreach (ProgressChapter::whereIn('channel_id',$publicChannels)
+                                ->select(['uid','book','para',
+                                'lang','title','channel_id',
+                                'progress','updated_at'])->cursor() as $row) {
             $currData = array(
                             $row->uid,
                             $row->book,