作者 lyh

gx

  1 +<?php
  2 +/**
  3 + * @remark :
  4 + * @name :UpgradeProjectCount.php
  5 + * @author :lyh
  6 + * @method :post
  7 + * @time :2024/1/8 9:03
  8 + */
  9 +
  10 +namespace App\Console\Commands\DayCount;
  11 +
  12 +use App\Models\Visit\Visit;
  13 +use App\Services\ProjectServer;
  14 +use Illuminate\Console\Command;
  15 +use Illuminate\Support\Facades\DB;
  16 +
  17 +class UpgradeProjectCount extends Command
  18 +{
  19 + /**
  20 + * The name and signature of the console command.
  21 + *
  22 + * @var string
  23 + */
  24 + protected $signature = 'count';
  25 +
  26 + /**
  27 + * The console command description.
  28 + *
  29 + * @var string
  30 + */
  31 + protected $description = '升级项目统计';
  32 +
  33 + public function handle(){
  34 + ProjectServer::useProject(439);
  35 + $this->count();
  36 + DB::disconnect('custom_mysql');
  37 + }
  38 +
  39 + /**
  40 + * @remark :日统计记录
  41 + * @name :count
  42 + * @author :lyh
  43 + * @method :post
  44 + * @time :2024/1/8 9:05
  45 + */
  46 + public function count(){
  47 + $list = DB::connection('custom_mysql')->table('gl_customer_visit')->select('updated_date')
  48 + ->groupBy('updated_date')->get()->toArray();
  49 + if(!empty($list)){
  50 + echo date('Y-m-d H:i:s') . '时间:'json_encode($list) . PHP_EOL;
  51 + }
  52 + echo date('Y-m-d H:i:s') . 'end' . PHP_EOL;
  53 + }
  54 +}