浏览代码

定时任务

任敬轩 2 年之前
父节点
当前提交
025fb73ecb
共有 1 个文件被更改,包括 63 次插入0 次删除
  1. 63 0
      app/Console/Commands/LogEmailSend.php

+ 63 - 0
app/Console/Commands/LogEmailSend.php

@@ -0,0 +1,63 @@
+<?php
+
+namespace App\Console\Commands;
+
+use Illuminate\Console\Command;
+use Illuminate\Support\Facades\Input;
+use Modules\Camera\Entities\CameraList;
+use Modules\Camera\Enum\CameraEnum;
+use Modules\Camera\Services\CameraServices;
+use Modules\Camera\Http\Controllers\Api\TdwyController;
+use Modules\Mine\Entities\MineList;
+use Modules\Mine\Entities\MineListExt;
+use Modules\Mine\Enum\MineEnum;
+use Modules\Mine\Services\MineServices;
+use Illuminate\Support\Facades\DB;
+
+class LogEmailSend extends Command
+{
+    /**
+     * The name and signature of the console command.
+     *
+     * @var string
+     */
+    protected $signature = 'log:emailsend';
+
+    /**
+     * 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 mixed
+     */
+    public function handle()
+    {
+        $this->logSendEmail();
+    }
+
+    //同步区域列表
+    public function logSendEmail()
+    {
+        $data['mine_id_list'] = '1,2,3';
+        $data['email'] = '123';
+        $data['created_at'] = date('Y-m-d H:i:s');
+        $data['updated_at'] = date('Y-m-d H:i:s');
+        DB::table('email')->insert($data);
+    }
+
+}