瀏覽代碼

刷进度图改为每周任务

visuddhinanda 3 年之前
父節點
當前提交
06b7075007
共有 2 個文件被更改,包括 48 次插入1 次删除
  1. 47 0
      app/Console/Commands/UpgradeWeekly.php
  2. 1 1
      app/Console/Kernel.php

+ 47 - 0
app/Console/Commands/UpgradeWeekly.php

@@ -0,0 +1,47 @@
+<?php
+
+namespace App\Console\Commands;
+
+use Illuminate\Console\Command;
+
+class UpgradeWeekly extends Command
+{
+    /**
+     * The name and signature of the console command.
+     *
+     * @var string
+     */
+    protected $signature = 'upgrade:weekly';
+
+    /**
+     * The console command description.
+     *
+     * @var string
+     */
+    protected $description = '周更';
+
+    /**
+     * Create a new command instance.
+     *
+     * @return void
+     */
+    public function __construct()
+    {
+        parent::__construct();
+    }
+
+    /**
+     * Execute the console command.
+     *
+     * @return int
+     */
+    public function handle()
+    {
+        # 段落更新图
+        $this->call('upgrade:chapterdynamic');
+        $this->call('upgrade:chapter.dynamic.weekly');
+        $this->call('export:offline');
+
+        return 0;
+    }
+}

+ 1 - 1
app/Console/Kernel.php

@@ -20,7 +20,7 @@ class Kernel extends ConsoleKernel
                  ->emailOutputTo(config("app.email.ScheduleEmailOutputTo"))
 				 ->emailOutputOnFailure(config("app.email.ScheduleEmailOutputOnFailure"));
 
-        $schedule->command('export:offline')
+        $schedule->command('upgrade:weekly')
                  ->weekly()
                  ->emailOutputOnFailure(config("app.email.ScheduleEmailOutputOnFailure"));
     }