UpgradeProjectCount.php
1.2 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
<?php
/**
* @remark :
* @name :UpgradeProjectCount.php
* @author :lyh
* @method :post
* @time :2024/1/8 9:03
*/
namespace App\Console\Commands\DayCount;
use App\Models\Visit\Visit;
use App\Services\ProjectServer;
use Illuminate\Console\Command;
use Illuminate\Support\Facades\DB;
class UpgradeProjectCount extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'upgrade_count';
/**
* The console command description.
*
* @var string
*/
protected $description = '升级项目统计';
public function handle(){
ProjectServer::useProject(439);
$this->count();
DB::disconnect('custom_mysql');
}
/**
* @remark :日统计记录
* @name :count
* @author :lyh
* @method :post
* @time :2024/1/8 9:05
*/
public function count(){
$list = DB::connection('custom_mysql')->table('gl_customer_visit')->select('updated_date')
->groupBy('updated_date')->get()->toArray();
if(!empty($list)){
echo date('Y-m-d H:i:s') . '时间:'.json_encode($list) . PHP_EOL;
}
echo date('Y-m-d H:i:s') . 'end' . PHP_EOL;
}
}