|
@@ -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);
|
335
|
$res += $this->relayDetail($task, $val);
|
|
345
|
- }
|
|
|
|
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,6 +431,17 @@ class RelayInquiry extends Command |
|
@@ -441,6 +431,17 @@ 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) {
|
|
|
|
434
|
+ $times = 1;
|
|
|
|
435
|
+ $inquiry_time = 1;
|
|
|
|
436
|
+
|
|
|
|
437
|
+ //需要多个ip访问的国家 随机2-5次访问,只有一次询盘
|
|
|
|
438
|
+ if (in_array($form->country_name, $this->multiple_ip_visit_country)) {
|
|
|
|
439
|
+ $times = mt_rand(2, 5); //随机次数
|
|
|
|
440
|
+ $inquiry_time = mt_rand(1, $times); //第几次询盘
|
|
|
|
441
|
+ $this->output('多次访问模拟:' . $times);
|
|
|
|
442
|
+ }
|
|
|
|
443
|
+ for ($i = 1; $i <= $times; $i++) {
|
|
|
|
444
|
+ $is_inquiry = $inquiry_time == $i;
|
|
444
|
//手机号过滤
|
445
|
//手机号过滤
|
|
445
|
$phone = $form->phone;
|
446
|
$phone = $form->phone;
|
|
446
|
$filter_phone = $this->get_rand($this->filter_phone);
|
447
|
$filter_phone = $this->get_rand($this->filter_phone);
|
|
@@ -480,11 +481,13 @@ class RelayInquiry extends Command |
|
@@ -480,11 +481,13 @@ class RelayInquiry extends Command |
|
480
|
$pre = 0;
|
481
|
$pre = 0;
|
|
481
|
$start_time = time();
|
482
|
$start_time = time();
|
|
482
|
$seconds = rand(300, 7200); // 开始时间 从5-2小时后开始
|
483
|
$seconds = rand(300, 7200); // 开始时间 从5-2小时后开始
|
|
|
|
484
|
+ if($is_inquiry) {
|
|
483
|
$exists = ReInquiryDetail::where('re_website', $domain)->where('email', $form->email)->first();
|
485
|
$exists = ReInquiryDetail::where('re_website', $domain)->where('email', $form->email)->first();
|
|
484
|
- if($exists){
|
486
|
+ if ($exists) {
|
|
485
|
$this->output('转发站点邮件已存在');
|
487
|
$this->output('转发站点邮件已存在');
|
|
486
|
continue;
|
488
|
continue;
|
|
487
|
}
|
489
|
}
|
|
|
|
490
|
+ }
|
|
488
|
// 写入推送详情
|
491
|
// 写入推送详情
|
|
489
|
$re_detail = ReInquiryDetail::createInquiry($task['id'], $form->id, $domain, $country_name, $ip, $form->full_name, $form->email, $phone, $message, $message_id, $device_port,
|
492
|
$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));
|
493
|
$user_agent, $referrer, $urls, $is_v6, date('Y-m-d H:i:s', $start_time + $seconds));
|
|
@@ -500,6 +503,7 @@ class RelayInquiry extends Command |
|
@@ -500,6 +503,7 @@ class RelayInquiry extends Command |
|
500
|
}
|
503
|
}
|
|
501
|
}
|
504
|
}
|
|
502
|
}
|
505
|
}
|
|
|
|
506
|
+ }
|
|
503
|
return true;
|
507
|
return true;
|
|
504
|
}
|
508
|
}
|
|
505
|
|
509
|
|
|
@@ -601,8 +605,11 @@ class RelayInquiry extends Command |
|
@@ -601,8 +605,11 @@ class RelayInquiry extends Command |
|
601
|
$form_message = $message;
|
605
|
$form_message = $message;
|
|
602
|
$message_id = 0;
|
606
|
$message_id = 0;
|
|
603
|
|
607
|
|
|
604
|
- // TODO 当原始询盘内容长度大于15个字符, 直接发送原始内容。
|
608
|
+ // TODO 当原始询盘内容长度大于15个字符, 60%几率直接发送原始内容。
|
|
605
|
if (strlen($message) >= 15) {
|
609
|
if (strlen($message) >= 15) {
|
|
|
|
610
|
+ $not_use_probability = AiCommand::where('key', 'fb_inquiry_text')->value('not_use_probability');
|
|
|
|
611
|
+ $randomNumber = rand(0, 100);
|
|
|
|
612
|
+ if($randomNumber < $not_use_probability){
|
|
606
|
//原内容非英语,转为对应语种
|
613
|
//原内容非英语,转为对应语种
|
|
607
|
if (is_numeric($form_message)) { //数字会被识别为中文
|
614
|
if (is_numeric($form_message)) { //数字会被识别为中文
|
|
608
|
$lang = 'en';
|
615
|
$lang = 'en';
|
|
@@ -612,6 +619,7 @@ class RelayInquiry extends Command |
|
@@ -612,6 +619,7 @@ class RelayInquiry extends Command |
|
612
|
}
|
619
|
}
|
|
613
|
return [$message, $message_id, $lang??''];
|
620
|
return [$message, $message_id, $lang??''];
|
|
614
|
}
|
621
|
}
|
|
|
|
622
|
+ }
|
|
615
|
|
623
|
|
|
616
|
//开启文案替换
|
624
|
//开启文案替换
|
|
617
|
if ($task['is_replace_text'] == 2) {
|
625
|
if ($task['is_replace_text'] == 2) {
|