正在显示
1 个修改的文件
包含
27 行增加
和
5 行删除
| @@ -8,6 +8,7 @@ use App\Models\Product\Product; | @@ -8,6 +8,7 @@ use App\Models\Product\Product; | ||
| 8 | use App\Models\Project\OnlineCheck; | 8 | use App\Models\Project\OnlineCheck; |
| 9 | use App\Models\Project\Project; | 9 | use App\Models\Project\Project; |
| 10 | use App\Models\Template\BCustomTemplate; | 10 | use App\Models\Template\BCustomTemplate; |
| 11 | +use App\Models\WebSetting\WebLanguage; | ||
| 11 | use App\Services\ProjectServer; | 12 | use App\Services\ProjectServer; |
| 12 | use Carbon\Carbon; | 13 | use Carbon\Carbon; |
| 13 | use GuzzleHttp\Client; | 14 | use GuzzleHttp\Client; |
| @@ -130,6 +131,19 @@ class WebTraffic extends Command | @@ -130,6 +131,19 @@ class WebTraffic extends Command | ||
| 130 | 'https://search.yahoo.com/' => 5, | 131 | 'https://search.yahoo.com/' => 5, |
| 131 | 'https://www.facebook.com/' => 5, | 132 | 'https://www.facebook.com/' => 5, |
| 132 | ]; | 133 | ]; |
| 134 | + | ||
| 135 | + //俄语 | ||
| 136 | + protected $eylyzb = [ | ||
| 137 | + 'https://www.yandex.com/' => 630, | ||
| 138 | + 'https://www.google.com/' => 30, | ||
| 139 | + 'http://www.google.com/' => 30, | ||
| 140 | + 'http://www.bing.com/' => 20, | ||
| 141 | + 'https://www.bing.com/' => 5, | ||
| 142 | + 'https://www.youtube.com/' => 5, | ||
| 143 | + 'https://search.yahoo.com/' => 5, | ||
| 144 | + 'https://www.facebook.com/' => 5, | ||
| 145 | + ]; | ||
| 146 | + | ||
| 133 | protected $otherzb = [700, 300]; //模拟访问来源占比 (非美国) google.com|google.其他后缀 | 147 | protected $otherzb = [700, 300]; //模拟访问来源占比 (非美国) google.com|google.其他后缀 |
| 134 | 148 | ||
| 135 | protected $pc_ua = [ | 149 | protected $pc_ua = [ |
| @@ -230,7 +244,7 @@ class WebTraffic extends Command | @@ -230,7 +244,7 @@ class WebTraffic extends Command | ||
| 230 | 'ip' => $ips[$project_key]['ip'], | 244 | 'ip' => $ips[$project_key]['ip'], |
| 231 | 'url' => $project['visit_urls'][$j], | 245 | 'url' => $project['visit_urls'][$j], |
| 232 | 'device_port' => $project['device_port'], | 246 | 'device_port' => $project['device_port'], |
| 233 | - 'referrer_url' => $this->getReferer($ips[$project_key]['ip_area']), | 247 | + 'referrer_url' => $this->getReferer($ips[$project_key]['ip_area'], $project['lang']), |
| 234 | 'user_agent' => $project['user_agent'], | 248 | 'user_agent' => $project['user_agent'], |
| 235 | ]; | 249 | ]; |
| 236 | Log::channel('traffic')->info('traffic project_id:' . $project['project_id'], $data); | 250 | Log::channel('traffic')->info('traffic project_id:' . $project['project_id'], $data); |
| @@ -293,12 +307,15 @@ class WebTraffic extends Command | @@ -293,12 +307,15 @@ class WebTraffic extends Command | ||
| 293 | $startTime = Carbon::now()->addMonths(-9)->startOfDay()->toDateTimeString(); | 307 | $startTime = Carbon::now()->addMonths(-9)->startOfDay()->toDateTimeString(); |
| 294 | $query->where('pdo.start_date', '<', $startTime); | 308 | $query->where('pdo.start_date', '<', $startTime); |
| 295 | } | 309 | } |
| 296 | - })->select('pdo.project_id')->forPage($page, 500)->get(); | 310 | + })->select(['pdo.project_id','gl_project.main_lang_id'])->forPage($page, 500)->get(); |
| 297 | //其他地方在引流的域名 | 311 | //其他地方在引流的域名 |
| 298 | $other = DB::connection('projects_mysql')->table('projects')->where('switch', 1)->pluck('domain')->toArray(); | 312 | $other = DB::connection('projects_mysql')->table('projects')->where('switch', 1)->pluck('domain')->toArray(); |
| 299 | - | ||
| 300 | $data = []; | 313 | $data = []; |
| 301 | foreach ($list as $project) { | 314 | foreach ($list as $project) { |
| 315 | + $lang = WebLanguage::getLangById($this->project['main_lang_id']??1)['short']; | ||
| 316 | + if(empty($project->domainInfo['domain'])){ | ||
| 317 | + continue; | ||
| 318 | + } | ||
| 302 | //其他地方在引流就不再引流了 | 319 | //其他地方在引流就不再引流了 |
| 303 | if(in_array($project->domainInfo['domain'], $other)){ | 320 | if(in_array($project->domainInfo['domain'], $other)){ |
| 304 | continue; | 321 | continue; |
| @@ -306,9 +323,9 @@ class WebTraffic extends Command | @@ -306,9 +323,9 @@ class WebTraffic extends Command | ||
| 306 | $data[] = [ | 323 | $data[] = [ |
| 307 | 'project_id' => $project['project_id'], | 324 | 'project_id' => $project['project_id'], |
| 308 | 'domain' => 'https://' . $project->domainInfo['domain'] . '/', | 325 | 'domain' => 'https://' . $project->domainInfo['domain'] . '/', |
| 326 | + 'lang' => $lang | ||
| 309 | ]; | 327 | ]; |
| 310 | } | 328 | } |
| 311 | - | ||
| 312 | return $data; | 329 | return $data; |
| 313 | } | 330 | } |
| 314 | 331 | ||
| @@ -440,7 +457,12 @@ class WebTraffic extends Command | @@ -440,7 +457,12 @@ class WebTraffic extends Command | ||
| 440 | /** | 457 | /** |
| 441 | * 获取访问来路 | 458 | * 获取访问来路 |
| 442 | */ | 459 | */ |
| 443 | - protected function getReferer($ip_area){ | 460 | + protected function getReferer($ip_area, $lang){ |
| 461 | + | ||
| 462 | + if($lang == 'ru'){ | ||
| 463 | + return $this->get_rand($this->eylyzb); | ||
| 464 | + } | ||
| 465 | + | ||
| 444 | if($ip_area == '美国'){ | 466 | if($ip_area == '美国'){ |
| 445 | $referer = $this->get_rand($this->lyzb); | 467 | $referer = $this->get_rand($this->lyzb); |
| 446 | }else{ | 468 | }else{ |
-
请 注册 或 登录 后发表评论