浏览代码

只输出公开channel

visuddhinanda 2 年之前
父节点
当前提交
5104b25388
共有 1 个文件被更改,包括 7 次插入3 次删除
  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;
             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(
             $currData = array(
                             $row->uid,
                             $row->uid,
                             $row->book,
                             $row->book,