浏览代码

工单定时任务

loustwo 4 年之前
父节点
当前提交
412e24fdd2
共有 1 个文件被更改,包括 45 次插入0 次删除
  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();
+    }
+}