作者 lyh

Merge branch 'dev' into develop

<?php
namespace App\Console\Commands\YesterdayCount;
use App\Models\CustomerVisit\CustomerVisitItem;
use App\Models\Project\DeployBuild;
use Illuminate\Console\Command;
use Illuminate\Support\Facades\DB;
class Yesterday extends Command
{
public $error = 0;
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'yesterday_count';
/**
* The console command description.
*
* @var string
*/
protected $description = '统计昨日数据';
/**
* @name :(定时执行)handle
* @author :lyh
* @method :post
* @time :2023/5/12 14:48
*/
public function handle()
{
$deployModel = new DeployBuild();
$list = $deployModel->list();
$data = [];
foreach ($list as $v){
$arr = [];
$yesterday = now()->subDay();
$arr['yesterday_pv_num'] = DB::table('gl_customer_visit_item')->whereDate('created_at', $yesterday)->where('domain',$v['test_domain'])->count();
$arr['yesterday_ip_num'] = DB::table('gl_customer_visit')->whereDate('created_at', $yesterday)->where('domain',$v['test_domain'])->count();
$arr['inquiry_num'] = DB::table('gl_inquiry_set')->whereDate('created_at', $yesterday)->where('project_id',$v['project_id'])->count();
$arr['date'] = date('Y-m-d',time());
$data[] = $arr;
}
DB::table('gl_yesterday_count')->insert($data);
echo $this->error;
}
}
... ...
... ... @@ -23,6 +23,7 @@ class Kernel extends ConsoleKernel
$schedule->command('rank_data_recomm_domain')->weeklyOn(1, '01:00')->withoutOverlapping(1); // 排名数据-引荐域名,每周一凌晨执行一次
$schedule->command('rank_data_week')->weeklyOn(1, '01:00')->withoutOverlapping(1); // 排名数据,每周一凌晨执行一次
$schedule->command('share_user')->dailyAt('01:00')->withoutOverlapping(1); // 清除用户ayr_share数据,每天凌晨1点执行一次
$schedule->command('yesterday_count')->dailyAt('01:00')->withoutOverlapping(1); // 清除用户ayr_share数据,每天凌晨1点执行一次
$schedule->command('web_traffic 1')->everyThirtyMinutes(); // 引流 1-3个月的项目,半小时一次
$schedule->command('web_traffic 2')->cron('*/18 * * * *'); // 引流 4-8个月的项目,18分钟一次
$schedule->command('web_traffic 3')->cron('*/12 * * * *'); // 引流 大于9个月的项目,12分钟一次
... ...
<?php
namespace App\Http\Controllers\Bside\HomeCount;
use App\Enums\Common\Code;
use App\Http\Controllers\Bside\BaseController;
class CountController extends BaseController
{
/**
* @name :(昨日统计数据)yesterday_count
* @author :lyh
* @method :post
* @time :2023/5/23 17:23
*/
public function count(){
$data = [];
//TODO::全球搜方案信息
//TODO::网站访问量统计
//TODO::关键字排名数据
//TODO::关键字排名数据
return $this->response('success',Code::SUCCESS,$data);
}
}
... ...
<?php
namespace App\Http\Logic\Bside\HomeCount;
use App\Http\Logic\Bside\BaseLogic;
class CountLogic extends BaseLogic
{
public function __construct()
{
parent::__construct();
$this->model = new Yes();
}
/**
* @name :(昨日统计数据)yesterday_count
* @author :lyh
* @method :post
* @time :2023/5/23 17:30
*/
public function yesterday_count(){
return $this->success();
}
}
... ...
... ... @@ -23,7 +23,7 @@ class DeptUserLogic extends BaseLogic
*/
public function dept_user_save(){
if(isset($this->param['id']) && !empty($this->param['id'])){
$rs = $this->dept_user_edit($this->param);
$rs = $this->dept_user_edit();
}else{
$rs = $this->dept_user_add();
}
... ... @@ -60,8 +60,8 @@ class DeptUserLogic extends BaseLogic
* @method :post
* @time :2023/5/17 17:54
*/
public function dept_user_edit($param){
$rs = $this->model->edit($param,['id'=>$this->param['id']]);
public function dept_user_edit(){
$rs = $this->model->edit($this->param,['id'=>$this->param['id']]);
if($rs === false){
$this->fail('error');
}
... ...
<?php
namespace App\Models\CustomerVisit;
use App\Models\Base;
class CustomerVisit extends Base
{
protected $table = 'gl_customer_visit';
}
... ...
<?php
namespace App\Models\CustomerVisit;
use App\Models\Base;
class CustomerVisitItem extends Base
{
protected $table = 'gl_customer_visit_item';
}
... ...
<?php
namespace App\Models\HomeCount;
use App\Models\Base;
class YesterdayCount extends Base
{
protected $table = 'gl_yesterday_count';
}
... ...