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