作者 lyh

gx

@@ -113,4 +113,7 @@ class UpgradeProjectCount extends Command @@ -113,4 +113,7 @@ class UpgradeProjectCount extends Command
113 $ip = DB::connection('custom_mysql')->table('gl_customer_visit')->whereDate('updated_date', $day)->count(); 113 $ip = DB::connection('custom_mysql')->table('gl_customer_visit')->whereDate('updated_date', $day)->count();
114 return $ip; 114 return $ip;
115 } 115 }
  116 +
  117 +
  118 +
116 } 119 }
  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\MonthlyCount;
  11 +
  12 +use App\Models\Project\Project;
  13 +use App\Models\Visit\Visit;
  14 +use App\Services\ProjectServer;
  15 +use Illuminate\Console\Command;
  16 +use Illuminate\Support\Facades\DB;
  17 +use App\Models\HomeCount\Count;
  18 +
  19 +class UpgradeProjectCount extends Command
  20 +{
  21 + /**
  22 + * The name and signature of the console command.
  23 + *
  24 + * @var string
  25 + */
  26 + protected $signature = 'upgrade_month_count';
  27 +
  28 + /**
  29 + * The console command description.
  30 + *
  31 + * @var string
  32 + */
  33 + protected $description = '升级项目统计';
  34 +
  35 + public function handle(){
  36 + ProjectServer::useProject(439);
  37 + $this->count();
  38 + DB::disconnect('custom_mysql');
  39 + }
  40 +
  41 + /**
  42 + * @remark :日统计记录
  43 + * @name :count
  44 + * @author :lyh
  45 + * @method :post
  46 + * @time :2024/1/8 9:05
  47 + */
  48 + public function count(){
  49 + $list = DB::connection('custom_mysql')->table('gl_customer_visit')
  50 + ->select(DB::raw('DATE_FORMAT(updated_date, "%Y-%m") as month'))
  51 + ->groupBy('month')->get()->toArray();
  52 + echo date('Y-m-d H:i:s') . '数据:'.json_encode($list) . PHP_EOL;
  53 + $project = new Project();
  54 + $projectInfo = $project->read(['id'=>439]);
  55 + echo date('Y-m-d H:i:s') . 'end' . PHP_EOL;
  56 + }
  57 +
  58 + /**
  59 + * @remark :询盘数量
  60 + * @name :inquiry_num
  61 + * @author :lyh
  62 + * @method :post
  63 + * @time :2024/1/8 9:24
  64 + */
  65 + public function inquiry_num($day){
  66 + $count = DB::connection('custom_mysql')->table('gl_customer_visit')->whereDate('updated_date', $day)->where('is_inquiry',1)->count();
  67 + return $count;
  68 + }
  69 +
  70 + /**
  71 + * @name :(统计pv)pv_num
  72 + * @author :lyh
  73 + * @method :post
  74 + * @time :2023/6/14 15:40
  75 + */
  76 + public function pv_num($day){
  77 + $pv = DB::connection('custom_mysql')->table('gl_customer_visit_item')->whereDate('updated_date', $day)->count();
  78 + return $pv;
  79 + }
  80 +
  81 + /**
  82 + * @name :(统计ip)ip_num
  83 + * @author :lyh
  84 + * @method :post
  85 + * @time :2023/6/14 15:40
  86 + */
  87 + public function ip_num($day){
  88 + $ip = DB::connection('custom_mysql')->table('gl_customer_visit')->whereDate('updated_date', $day)->count();
  89 + return $ip;
  90 + }
  91 +
  92 +
  93 +
  94 +}