正在显示
1 个修改的文件
包含
64 行增加
和
63 行删除
| @@ -332,17 +332,7 @@ class RelayInquiry extends Command | @@ -332,17 +332,7 @@ class RelayInquiry extends Command | ||
| 332 | try { | 332 | try { |
| 333 | $res = false; | 333 | $res = false; |
| 334 | foreach ($ad_task as $task){ | 334 | foreach ($ad_task as $task){ |
| 335 | - //需要多个ip访问的国家 随机2-5次访问,只有一次询盘 | ||
| 336 | - if (in_array($val->country_name, $this->multiple_ip_visit_country)) { | ||
| 337 | - $times = mt_rand(2, 5); //随机次数 | ||
| 338 | - $inquiry_time = mt_rand(1, $times); //第几次询盘 | ||
| 339 | - $this->output('多次访问模拟:' . $times); | ||
| 340 | - for ($i = 1; $i <= $times; $i++) { | ||
| 341 | - $res += $this->relayDetail($task, $val, $inquiry_time == $i); | ||
| 342 | - } | ||
| 343 | - }else{ | ||
| 344 | - $res += $this->relayDetail($task, $val); | ||
| 345 | - } | 335 | + $res += $this->relayDetail($task, $val); |
| 346 | $res += $this->relayShopDetail($task, $val); | 336 | $res += $this->relayShopDetail($task, $val); |
| 347 | $res += $this->relayFobDetail($task, $val); | 337 | $res += $this->relayFobDetail($task, $val); |
| 348 | } | 338 | } |
| @@ -405,7 +395,7 @@ class RelayInquiry extends Command | @@ -405,7 +395,7 @@ class RelayInquiry extends Command | ||
| 405 | * @param $form | 395 | * @param $form |
| 406 | * @return bool | 396 | * @return bool |
| 407 | */ | 397 | */ |
| 408 | - public function relayDetail($task, $form, $is_inquiry = true) | 398 | + public function relayDetail($task, $form) |
| 409 | { | 399 | { |
| 410 | $this->output('获取转发对象'); | 400 | $this->output('获取转发对象'); |
| 411 | if(empty($task['target'] )){ | 401 | if(empty($task['target'] )){ |
| @@ -441,62 +431,73 @@ class RelayInquiry extends Command | @@ -441,62 +431,73 @@ class RelayInquiry extends Command | ||
| 441 | } | 431 | } |
| 442 | $this->logChannel()->info('随机域名', array_column($random_data, 'url')); | 432 | $this->logChannel()->info('随机域名', array_column($random_data, 'url')); |
| 443 | foreach ($random_data as $item) { | 433 | foreach ($random_data as $item) { |
| 444 | - //手机号过滤 | ||
| 445 | - $phone = $form->phone; | ||
| 446 | - $filter_phone = $this->get_rand($this->filter_phone); | ||
| 447 | - if($filter_phone == 0){ | ||
| 448 | - $phone = trim(str_replace("+", '', $phone)); | ||
| 449 | - }elseif($filter_phone == 1){ | ||
| 450 | - $phone = ''; | ||
| 451 | - } | ||
| 452 | - | ||
| 453 | - // 推送站点 | ||
| 454 | - $domain = $item['url']; | ||
| 455 | - $is_v6 = $item['is_v6']; | ||
| 456 | - $re_website = 'https://' . $domain . '/'; | ||
| 457 | - | ||
| 458 | - //urls | ||
| 459 | - list($urls, $lang, $inquiry_product_url) = $this->getUrls($is_v6, $domain, $re_website, $form, $task); | ||
| 460 | - if(!$urls){ | ||
| 461 | - continue; | 434 | + //需要多个ip访问的国家 随机2-5次访问,只有一次询盘 |
| 435 | + $times = 1; | ||
| 436 | + $inquiry_time = 1; | ||
| 437 | + if (in_array($form->country_name, $this->multiple_ip_visit_country)) { | ||
| 438 | + $times = mt_rand(2, 5); //随机次数 | ||
| 439 | + $inquiry_time = mt_rand(1, $times); //第几次询盘 | ||
| 440 | + $this->output('多次访问模拟:' . $times); | ||
| 462 | } | 441 | } |
| 442 | + for ($i = 1; $i <= $times; $i++) { | ||
| 443 | + $is_inquiry = $inquiry_time == $i; | ||
| 444 | + //手机号过滤 | ||
| 445 | + $phone = $form->phone; | ||
| 446 | + $filter_phone = $this->get_rand($this->filter_phone); | ||
| 447 | + if($filter_phone == 0){ | ||
| 448 | + $phone = trim(str_replace("+", '', $phone)); | ||
| 449 | + }elseif($filter_phone == 1){ | ||
| 450 | + $phone = ''; | ||
| 451 | + } | ||
| 463 | 452 | ||
| 464 | - //ip | ||
| 465 | - $ip_data = $this->getIpData($form->country_name); | ||
| 466 | - $ip = $ip_data->ip; | ||
| 467 | - $country_name = $ip_data->ip_area; | ||
| 468 | - | ||
| 469 | - //message | ||
| 470 | - list($message, $message_id, $msg_lang) = $this->getMessage($task, $form->message, $domain, $inquiry_product_url); | ||
| 471 | - $lang = $lang ?: $msg_lang; | 453 | + // 推送站点 |
| 454 | + $domain = $item['url']; | ||
| 455 | + $is_v6 = $item['is_v6']; | ||
| 456 | + $re_website = 'https://' . $domain . '/'; | ||
| 472 | 457 | ||
| 473 | - $this->output('获取转发设备信息'); | ||
| 474 | - // 客户端 头信息 来源 | ||
| 475 | - $device_port = $form->email ? '1' : '2'; //1 pc 2移动端 | ||
| 476 | - $user_agent = $form->email ? Arr::random($this->pc_ua) : Arr::random($this->mobile_ua); | ||
| 477 | - $referrer = $this->getReferer($country_name, $lang); | ||
| 478 | - $this->output('写入数据'); | 458 | + //urls |
| 459 | + list($urls, $lang, $inquiry_product_url) = $this->getUrls($is_v6, $domain, $re_website, $form, $task); | ||
| 460 | + if(!$urls){ | ||
| 461 | + continue; | ||
| 462 | + } | ||
| 479 | 463 | ||
| 480 | - $pre = 0; | ||
| 481 | - $start_time = time(); | ||
| 482 | - $seconds = rand(300, 7200); // 开始时间 从5-2小时后开始 | ||
| 483 | - $exists = ReInquiryDetail::where('re_website', $domain)->where('email', $form->email)->first(); | ||
| 484 | - if($exists){ | ||
| 485 | - $this->output('转发站点邮件已存在'); | ||
| 486 | - continue; | ||
| 487 | - } | ||
| 488 | - // 写入推送详情 | ||
| 489 | - $re_detail = ReInquiryDetail::createInquiry($task['id'], $form->id, $domain, $country_name, $ip, $form->full_name, $form->email, $phone, $message, $message_id, $device_port, | ||
| 490 | - $user_agent, $referrer, $urls, $is_v6, date('Y-m-d H:i:s', $start_time + $seconds)); | ||
| 491 | - foreach ($urls as $k=>$v){ | ||
| 492 | - $pre++; | ||
| 493 | - $seconds += rand(5,60); | ||
| 494 | - ReInquiryDetailLog::createInquiryLog($re_detail->id, ReInquiryDetailLog::TYPE_VISIT, $pre, $v, date('Y-m-d H:i:s', $start_time + $seconds)); | ||
| 495 | - // 最后一次访问询盘 加上询盘 | ||
| 496 | - if($is_inquiry && $k+1 >= count($urls)){ | ||
| 497 | - $seconds += rand(30,120); | 464 | + //ip |
| 465 | + $ip_data = $this->getIpData($form->country_name); | ||
| 466 | + $ip = $ip_data->ip; | ||
| 467 | + $country_name = $ip_data->ip_area; | ||
| 468 | + | ||
| 469 | + //message | ||
| 470 | + list($message, $message_id, $msg_lang) = $this->getMessage($task, $form->message, $domain, $inquiry_product_url); | ||
| 471 | + $lang = $lang ?: $msg_lang; | ||
| 472 | + | ||
| 473 | + $this->output('获取转发设备信息'); | ||
| 474 | + // 客户端 头信息 来源 | ||
| 475 | + $device_port = $form->email ? '1' : '2'; //1 pc 2移动端 | ||
| 476 | + $user_agent = $form->email ? Arr::random($this->pc_ua) : Arr::random($this->mobile_ua); | ||
| 477 | + $referrer = $this->getReferer($country_name, $lang); | ||
| 478 | + $this->output('写入数据'); | ||
| 479 | + | ||
| 480 | + $pre = 0; | ||
| 481 | + $start_time = time(); | ||
| 482 | + $seconds = rand(300, 7200); // 开始时间 从5-2小时后开始 | ||
| 483 | + $exists = ReInquiryDetail::where('re_website', $domain)->where('email', $form->email)->first(); | ||
| 484 | + if($exists){ | ||
| 485 | + $this->output('转发站点邮件已存在'); | ||
| 486 | + continue; | ||
| 487 | + } | ||
| 488 | + // 写入推送详情 | ||
| 489 | + $re_detail = ReInquiryDetail::createInquiry($task['id'], $form->id, $domain, $country_name, $ip, $form->full_name, $form->email, $phone, $message, $message_id, $device_port, | ||
| 490 | + $user_agent, $referrer, $urls, $is_v6, date('Y-m-d H:i:s', $start_time + $seconds)); | ||
| 491 | + foreach ($urls as $k=>$v){ | ||
| 498 | $pre++; | 492 | $pre++; |
| 499 | - ReInquiryDetailLog::createInquiryLog($re_detail->id, ReInquiryDetailLog::TYPE_INQUIRY, $pre, $v, date('Y-m-d H:i:s', $start_time + $seconds)); | 493 | + $seconds += rand(5,60); |
| 494 | + ReInquiryDetailLog::createInquiryLog($re_detail->id, ReInquiryDetailLog::TYPE_VISIT, $pre, $v, date('Y-m-d H:i:s', $start_time + $seconds)); | ||
| 495 | + // 最后一次访问询盘 加上询盘 | ||
| 496 | + if($is_inquiry && $k+1 >= count($urls)){ | ||
| 497 | + $seconds += rand(30,120); | ||
| 498 | + $pre++; | ||
| 499 | + ReInquiryDetailLog::createInquiryLog($re_detail->id, ReInquiryDetailLog::TYPE_INQUIRY, $pre, $v, date('Y-m-d H:i:s', $start_time + $seconds)); | ||
| 500 | + } | ||
| 500 | } | 501 | } |
| 501 | } | 502 | } |
| 502 | } | 503 | } |
-
请 注册 或 登录 后发表评论