|
...
|
...
|
@@ -299,22 +299,22 @@ class WebTraffic extends Command |
|
|
|
->where('gl_project.is_upgrade', 0) //非升级项目
|
|
|
|
->where('gl_project.main_lang_id', '<>', $ru_lang_id) //非俄语站
|
|
|
|
->where(function ($query) use ($type) {
|
|
|
|
if($type == 1){
|
|
|
|
//1-3个月项目
|
|
|
|
$startTime = Carbon::now()->addMonths(-4)->toDateString();
|
|
|
|
$endTime = Carbon::now()->addMonths(-1)->toDateString();
|
|
|
|
$query->whereBetween('pdo.start_date', [$startTime,$endTime]);
|
|
|
|
}elseif($type == 2){
|
|
|
|
//4-8个月项目
|
|
|
|
$startTime = Carbon::now()->addMonths(-9)->startOfDay()->toDateTimeString();
|
|
|
|
$endTime = Carbon::now()->addMonths(-4)->endOfDay()->toDateTimeString();
|
|
|
|
$query->whereBetween('pdo.start_date', [$startTime,$endTime]);
|
|
|
|
}else{
|
|
|
|
//大于9个月项目
|
|
|
|
$startTime = Carbon::now()->addMonths(-9)->startOfDay()->toDateTimeString();
|
|
|
|
$query->where('pdo.start_date', '<', $startTime);
|
|
|
|
}
|
|
|
|
})->select(['pdo.project_id','gl_project.main_lang_id','gl_project.id'])->forPage($page, 500)->get();
|
|
|
|
if($type == 1){
|
|
|
|
//1-3个月项目
|
|
|
|
$startTime = Carbon::now()->addMonths(-4)->toDateString();
|
|
|
|
$endTime = Carbon::now()->addMonths(-1)->toDateString();
|
|
|
|
$query->whereBetween('pdo.start_date', [$startTime,$endTime]);
|
|
|
|
}elseif($type == 2){
|
|
|
|
//4-8个月项目
|
|
|
|
$startTime = Carbon::now()->addMonths(-9)->startOfDay()->toDateTimeString();
|
|
|
|
$endTime = Carbon::now()->addMonths(-4)->endOfDay()->toDateTimeString();
|
|
|
|
$query->whereBetween('pdo.start_date', [$startTime,$endTime]);
|
|
|
|
}else{
|
|
|
|
//大于9个月项目
|
|
|
|
$startTime = Carbon::now()->addMonths(-9)->startOfDay()->toDateTimeString();
|
|
|
|
$query->where('pdo.start_date', '<', $startTime);
|
|
|
|
}
|
|
|
|
})->select(['pdo.project_id','gl_project.main_lang_id','gl_project.id'])->forPage($page, 500)->get();
|
|
|
|
//其他地方在引流的域名
|
|
|
|
$other = DB::connection('projects_mysql')->table('projects')->where('switch', 1)->pluck('domain')->toArray();
|
|
|
|
$data = [];
|
|
...
|
...
|
@@ -391,8 +391,8 @@ class WebTraffic extends Command |
|
|
|
foreach ($project_ids as $project_id){
|
|
|
|
//引流配置
|
|
|
|
$config = WebTrafficConfig::getCacheInfoByProjectId($project_id);
|
|
|
|
$main_countries = $config->main_countries ? explode(',',$config->main_countries) : [];
|
|
|
|
$filter_countries = $config->filter_countries ? explode(',',$config->filter_countries) : [];
|
|
|
|
$main_countries = !empty($config->main_countries) ? explode(',',$config->main_countries) : [];
|
|
|
|
$filter_countries = !empty($config->filter_countries) ? explode(',',$config->filter_countries) : [];
|
|
|
|
|
|
|
|
//根据地区随机取该地区的IP
|
|
|
|
$ipdata = DB::table('gl_xunpan_ipdata')->whereIn('ip_area', $areas)
|
...
|
...
|
|