|
1
|
-<?php
|
|
|
|
2
|
-/**
|
|
|
|
3
|
- * @remark :
|
|
|
|
4
|
- * @name :UpdateHeartbeat.php
|
|
|
|
5
|
- * @author :lyh
|
|
|
|
6
|
- * @method :post
|
|
|
|
7
|
- * @time :2024/8/28 15:13
|
|
|
|
8
|
- */
|
|
|
|
9
|
-
|
|
|
|
10
|
-namespace App\Console\Commands\Update;
|
|
|
|
11
|
-
|
|
|
|
12
|
-use App\Models\Log\OperationHeartbeat;
|
|
|
|
13
|
-use Illuminate\Console\Command;
|
|
|
|
14
|
-
|
|
|
|
15
|
-
|
|
|
|
16
|
-class UpdateHeartbeat extends Command
|
|
|
|
17
|
-{
|
|
|
|
18
|
- /**
|
|
|
|
19
|
- * The name and signature of the console command.
|
|
|
|
20
|
- *
|
|
|
|
21
|
- * @var string
|
|
|
|
22
|
- */
|
|
|
|
23
|
- protected $signature = 'operation_heartbeat';
|
|
|
|
24
|
-
|
|
|
|
25
|
- /**
|
|
|
|
26
|
- * The console command description.
|
|
|
|
27
|
- *
|
|
|
|
28
|
- * @var string
|
|
|
|
29
|
- */
|
|
|
|
30
|
- protected $description = '心跳半小时未操作更新为未操作';
|
|
|
|
31
|
-
|
|
|
|
32
|
-
|
|
|
|
33
|
- /**
|
|
|
|
34
|
- * @remark :更新半小时未操作的界面
|
|
|
|
35
|
- * @name :handle
|
|
|
|
36
|
- * @author :lyh
|
|
|
|
37
|
- * @method :post
|
|
|
|
38
|
- * @time :2024/8/28 15:25
|
|
|
|
39
|
- */
|
|
|
|
40
|
- public function handle(){
|
|
|
|
41
|
- $date = date('Y-m-d H:i:s',time() - 10 * 60);
|
|
|
|
42
|
- $operationHeartbeatModel = new OperationHeartbeat();
|
|
|
|
43
|
- $operationHeartbeatModel->edit(['status'=>0],['updated_at'=>['<=',$date]]);
|
|
|
|
44
|
- echo date('Y-m-d H:i:s') . 'end' . PHP_EOL;
|
|
|
|
45
|
- return true;
|
|
|
|
46
|
- }
|
|
|
|
47
|
-} |
|
|