GeoCount.php
1.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
<?php
/**
* @remark :
* @name :GeoCount.php
* @author :lyh
* @method :post
* @time :2025/10/13 16:05
*/
namespace App\Console\Commands\Geo;
use App\Models\Geo\GeoQuestionLog;
use Illuminate\Console\Command;
use Illuminate\Support\Carbon;
class GeoCount extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'geo_count';
public $porject_id;//记录当时执行的project_id
/**
* The console command description.
*
* @var string
*/
protected $description = 'geo统计数据';
public function handle(){
}
/**
* @remark :方法
* @name :_action
* @author :lyh
* @method :post
* @time :2025/10/13 16:20
*/
public function _action()
{
//获取前一天的项目id
$date = Carbon::yesterday()->format('Y-m-d');
$start = $date.' 00:00:00';
$end = $date.' 23:59:59';
$geoLogModel = new GeoQuestionLog();
$geoLogModel->formatQuery(['created_at' => ['between',[$start,$end]]])->distinct()->pluck('project_id');
}
}