作者 lyh

Merge branch 'dev' into develop

  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['date'] = date('Y-m-d',time());
  44 + $data[] = $arr;
  45 + }
  46 + DB::table('gl_yesterday_count')->insert($data);
  47 + echo $this->error;
  48 + }
  49 +}
@@ -23,6 +23,7 @@ class Kernel extends ConsoleKernel @@ -23,6 +23,7 @@ class Kernel extends ConsoleKernel
23 $schedule->command('rank_data_recomm_domain')->weeklyOn(1, '01:00')->withoutOverlapping(1); // 排名数据-引荐域名,每周一凌晨执行一次 23 $schedule->command('rank_data_recomm_domain')->weeklyOn(1, '01:00')->withoutOverlapping(1); // 排名数据-引荐域名,每周一凌晨执行一次
24 $schedule->command('rank_data_week')->weeklyOn(1, '01:00')->withoutOverlapping(1); // 排名数据,每周一凌晨执行一次 24 $schedule->command('rank_data_week')->weeklyOn(1, '01:00')->withoutOverlapping(1); // 排名数据,每周一凌晨执行一次
25 $schedule->command('share_user')->dailyAt('01:00')->withoutOverlapping(1); // 清除用户ayr_share数据,每天凌晨1点执行一次 25 $schedule->command('share_user')->dailyAt('01:00')->withoutOverlapping(1); // 清除用户ayr_share数据,每天凌晨1点执行一次
  26 + $schedule->command('yesterday_count')->dailyAt('01:00')->withoutOverlapping(1); // 清除用户ayr_share数据,每天凌晨1点执行一次
26 $schedule->command('web_traffic 1')->everyThirtyMinutes(); // 引流 1-3个月的项目,半小时一次 27 $schedule->command('web_traffic 1')->everyThirtyMinutes(); // 引流 1-3个月的项目,半小时一次
27 $schedule->command('web_traffic 2')->cron('*/18 * * * *'); // 引流 4-8个月的项目,18分钟一次 28 $schedule->command('web_traffic 2')->cron('*/18 * * * *'); // 引流 4-8个月的项目,18分钟一次
28 $schedule->command('web_traffic 3')->cron('*/12 * * * *'); // 引流 大于9个月的项目,12分钟一次 29 $schedule->command('web_traffic 3')->cron('*/12 * * * *'); // 引流 大于9个月的项目,12分钟一次
  1 +<?php
  2 +
  3 +namespace App\Http\Controllers\Bside\HomeCount;
  4 +
  5 +use App\Enums\Common\Code;
  6 +use App\Http\Controllers\Bside\BaseController;
  7 +
  8 +class CountController extends BaseController
  9 +{
  10 + /**
  11 + * @name :(昨日统计数据)yesterday_count
  12 + * @author :lyh
  13 + * @method :post
  14 + * @time :2023/5/23 17:23
  15 + */
  16 + public function count(){
  17 + $data = [];
  18 + //TODO::全球搜方案信息
  19 + //TODO::网站访问量统计
  20 + //TODO::关键字排名数据
  21 + //TODO::关键字排名数据
  22 + return $this->response('success',Code::SUCCESS,$data);
  23 + }
  24 +
  25 +
  26 +}
  1 +<?php
  2 +
  3 +namespace App\Http\Logic\Bside\HomeCount;
  4 +
  5 +use App\Http\Logic\Bside\BaseLogic;
  6 +
  7 +class CountLogic extends BaseLogic
  8 +{
  9 + public function __construct()
  10 + {
  11 + parent::__construct();
  12 +
  13 + $this->model = new Yes();
  14 + }
  15 +
  16 + /**
  17 + * @name :(昨日统计数据)yesterday_count
  18 + * @author :lyh
  19 + * @method :post
  20 + * @time :2023/5/23 17:30
  21 + */
  22 + public function yesterday_count(){
  23 + return $this->success();
  24 + }
  25 +}
@@ -23,7 +23,7 @@ class DeptUserLogic extends BaseLogic @@ -23,7 +23,7 @@ class DeptUserLogic extends BaseLogic
23 */ 23 */
24 public function dept_user_save(){ 24 public function dept_user_save(){
25 if(isset($this->param['id']) && !empty($this->param['id'])){ 25 if(isset($this->param['id']) && !empty($this->param['id'])){
26 - $rs = $this->dept_user_edit($this->param); 26 + $rs = $this->dept_user_edit();
27 }else{ 27 }else{
28 $rs = $this->dept_user_add(); 28 $rs = $this->dept_user_add();
29 } 29 }
@@ -60,8 +60,8 @@ class DeptUserLogic extends BaseLogic @@ -60,8 +60,8 @@ class DeptUserLogic extends BaseLogic
60 * @method :post 60 * @method :post
61 * @time :2023/5/17 17:54 61 * @time :2023/5/17 17:54
62 */ 62 */
63 - public function dept_user_edit($param){  
64 - $rs = $this->model->edit($param,['id'=>$this->param['id']]); 63 + public function dept_user_edit(){
  64 + $rs = $this->model->edit($this->param,['id'=>$this->param['id']]);
65 if($rs === false){ 65 if($rs === false){
66 $this->fail('error'); 66 $this->fail('error');
67 } 67 }
  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 +}
  1 +<?php
  2 +
  3 +namespace App\Models\HomeCount;
  4 +
  5 +use App\Models\Base;
  6 +
  7 +class YesterdayCount extends Base
  8 +{
  9 + protected $table = 'gl_yesterday_count';
  10 +}