作者 lyh

gx

  1 +<?php
  2 +
  3 +namespace App\Console\Commands\YesterdayCount;
  4 +
  5 +use App\Models\CustomerVisit\CustomerVisitItem;
  6 +use App\Models\Project\DeployBuild;
  7 +use Illuminate\Console\Command;
  8 +use Illuminate\Support\Facades\DB;
  9 +
  10 +class Yesterday extends Command
  11 +{
  12 + public $error = 0;
  13 + /**
  14 + * The name and signature of the console command.
  15 + *
  16 + * @var string
  17 + */
  18 + protected $signature = 'yesterday_count';
  19 +
  20 + /**
  21 + * The console command description.
  22 + *
  23 + * @var string
  24 + */
  25 + protected $description = '统计昨日数据';
  26 + /**
  27 + * @name :(定时执行)handle
  28 + * @author :lyh
  29 + * @method :post
  30 + * @time :2023/5/12 14:48
  31 + */
  32 + public function handle()
  33 + {
  34 + $deployModel = new DeployBuild();
  35 + $list = $deployModel->list();
  36 + $data = [];
  37 + foreach ($list as $v){
  38 + $arr = [];
  39 + $yesterday = now()->subDay();
  40 + $arr['yesterday_pv_num'] = DB::table('gl_customer_visit_item')->whereDate('created_at', $yesterday)->where('domain',$v['test_domain'])->count();
  41 + $arr['yesterday_ip_num'] = DB::table('gl_customer_visit')->whereDate('created_at', $yesterday)->where('domain',$v['test_domain'])->count();
  42 + $arr['inquiry_num'] = DB::table('gl_inquiry_set')->whereDate('created_at', $yesterday)->where('project_id',$v['project_id'])->count();
  43 + $arr['rank_compliance_num'] = DB::table('rank_compliance_num')->whereDate('created_at', $yesterday)->where('project_id',$v['project_id'])->count();
  44 + }
  45 + }
  46 +}
@@ -24,12 +24,9 @@ class AyrReleaseRequest extends FormRequest @@ -24,12 +24,9 @@ class AyrReleaseRequest extends FormRequest
24 { 24 {
25 return [ 25 return [
26 'title'=>'required', 26 'title'=>'required',
27 -// 'images'=>'required|array',  
28 -// 'video'=>'required',  
29 'content'=>'required', 27 'content'=>'required',
30 'share_id'=>'required', 28 'share_id'=>'required',
31 'platforms'=>'required|array', 29 'platforms'=>'required|array',
32 -// 'schedule_date'=>'required',  
33 ]; 30 ];
34 } 31 }
35 32
  1 +<?php
  2 +
  3 +namespace App\Models\CustomerVisit;
  4 +
  5 +use App\Models\Base;
  6 +
  7 +class CustomerVisit extends Base
  8 +{
  9 + protected $table = 'gl_customer_visit';
  10 +}
  1 +<?php
  2 +
  3 +namespace App\Models\CustomerVisit;
  4 +
  5 +use App\Models\Base;
  6 +
  7 +class CustomerVisitItem extends Base
  8 +{
  9 + protected $table = 'gl_customer_visit_item';
  10 +}