Browse Source

使用 $filename 变量

visuddhinanda 3 years ago
parent
commit
18e9994ace
1 changed files with 3 additions and 2 deletions
  1. 3 2
      app/Console/Commands/ExportNissaya.php

+ 3 - 2
app/Console/Commands/ExportNissaya.php

@@ -49,8 +49,9 @@ class ExportNissaya extends Command
             $channels[] = $value->uid;
             $channels[] = $value->uid;
         }
         }
         $this->info('channel:'.count($channels));
         $this->info('channel:'.count($channels));
-        Storage::disk('local')->put("public/export/nissaya.csv", "");
-        $file = fopen(storage_path('app/public/export/nissaya.csv'),"w");
+        $filename = "public/export/nissaya.csv";
+        Storage::disk('local')->put($filename, "");
+        $file = fopen(storage_path("app/$filename"),"w");
         $bar = $this->output->createProgressBar(Sentence::whereIn('channel_uid',$channels)->count());
         $bar = $this->output->createProgressBar(Sentence::whereIn('channel_uid',$channels)->count());
         foreach (Sentence::whereIn('channel_uid',$channels)->select('content')->cursor() as $sent) {
         foreach (Sentence::whereIn('channel_uid',$channels)->select('content')->cursor() as $sent) {
             $lines = explode("\n",$sent->content);
             $lines = explode("\n",$sent->content);