Browse Source

工单定时任务

loustwo 4 years ago
parent
commit
412e24fdd2
1 changed files with 45 additions and 0 deletions
  1. 45 0
      app/Console/Commands/WorkOrderTimingTask.php

+ 45 - 0
app/Console/Commands/WorkOrderTimingTask.php

@@ -0,0 +1,45 @@
+<?php
+
+namespace App\Console\Commands;
+
+use App\Services\WorkOrderService;
+use Illuminate\Console\Command;
+
+class WorkOrderTimingTask extends Command
+{
+    /**
+     * The name and signature of the console command.
+     *
+     * @var string
+     */
+    protected $signature = 'workOrder:timingTask';
+
+    /**
+     * The console command description.
+     *
+     * @var string
+     */
+    protected $description = 'Command description';
+
+    /**
+     * Create a new command instance.
+     *
+     * @return void
+     */
+    public function __construct()
+    {
+        parent::__construct();
+    }
+
+    /**
+     * Execute the console command.
+     *
+     * @return int
+     */
+    public function handle()
+    {
+        /** @var WorkOrderService $service */
+        $service = App('WorkOrderService');
+        $service->timingTask();
+    }
+}