|
...
|
...
|
@@ -332,17 +332,7 @@ class RelayInquiry extends Command |
|
|
|
try {
|
|
|
|
$res = false;
|
|
|
|
foreach ($ad_task as $task){
|
|
|
|
//需要多个ip访问的国家 随机2-5次访问,只有一次询盘
|
|
|
|
if (in_array($val->country_name, $this->multiple_ip_visit_country)) {
|
|
|
|
$times = mt_rand(2, 5); //随机次数
|
|
|
|
$inquiry_time = mt_rand(1, $times); //第几次询盘
|
|
|
|
$this->output('多次访问模拟:' . $times);
|
|
|
|
for ($i = 1; $i <= $times; $i++) {
|
|
|
|
$res += $this->relayDetail($task, $val, $inquiry_time == $i);
|
|
|
|
}
|
|
|
|
}else{
|
|
|
|
$res += $this->relayDetail($task, $val);
|
|
|
|
}
|
|
|
|
$res += $this->relayShopDetail($task, $val);
|
|
|
|
$res += $this->relayFobDetail($task, $val);
|
|
|
|
}
|
|
...
|
...
|
@@ -405,7 +395,7 @@ class RelayInquiry extends Command |
|
|
|
* @param $form
|
|
|
|
* @return bool
|
|
|
|
*/
|
|
|
|
public function relayDetail($task, $form, $is_inquiry = true)
|
|
|
|
public function relayDetail($task, $form)
|
|
|
|
{
|
|
|
|
$this->output('获取转发对象');
|
|
|
|
if(empty($task['target'] )){
|
|
...
|
...
|
@@ -441,6 +431,17 @@ class RelayInquiry extends Command |
|
|
|
}
|
|
|
|
$this->logChannel()->info('随机域名', array_column($random_data, 'url'));
|
|
|
|
foreach ($random_data as $item) {
|
|
|
|
$times = 1;
|
|
|
|
$inquiry_time = 1;
|
|
|
|
|
|
|
|
//需要多个ip访问的国家 随机2-5次访问,只有一次询盘
|
|
|
|
if (in_array($form->country_name, $this->multiple_ip_visit_country)) {
|
|
|
|
$times = mt_rand(2, 5); //随机次数
|
|
|
|
$inquiry_time = mt_rand(1, $times); //第几次询盘
|
|
|
|
$this->output('多次访问模拟:' . $times);
|
|
|
|
}
|
|
|
|
for ($i = 1; $i <= $times; $i++) {
|
|
|
|
$is_inquiry = $inquiry_time == $i;
|
|
|
|
//手机号过滤
|
|
|
|
$phone = $form->phone;
|
|
|
|
$filter_phone = $this->get_rand($this->filter_phone);
|
|
...
|
...
|
@@ -480,11 +481,13 @@ class RelayInquiry extends Command |
|
|
|
$pre = 0;
|
|
|
|
$start_time = time();
|
|
|
|
$seconds = rand(300, 7200); // 开始时间 从5-2小时后开始
|
|
|
|
if($is_inquiry) {
|
|
|
|
$exists = ReInquiryDetail::where('re_website', $domain)->where('email', $form->email)->first();
|
|
|
|
if($exists){
|
|
|
|
if ($exists) {
|
|
|
|
$this->output('转发站点邮件已存在');
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// 写入推送详情
|
|
|
|
$re_detail = ReInquiryDetail::createInquiry($task['id'], $form->id, $domain, $country_name, $ip, $form->full_name, $form->email, $phone, $message, $message_id, $device_port,
|
|
|
|
$user_agent, $referrer, $urls, $is_v6, date('Y-m-d H:i:s', $start_time + $seconds));
|
|
...
|
...
|
@@ -500,6 +503,7 @@ class RelayInquiry extends Command |
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
...
|
...
|
@@ -601,8 +605,11 @@ class RelayInquiry extends Command |
|
|
|
$form_message = $message;
|
|
|
|
$message_id = 0;
|
|
|
|
|
|
|
|
// TODO 当原始询盘内容长度大于15个字符, 直接发送原始内容。
|
|
|
|
// TODO 当原始询盘内容长度大于15个字符, 60%几率直接发送原始内容。
|
|
|
|
if (strlen($message) >= 15) {
|
|
|
|
$not_use_probability = AiCommand::where('key', 'fb_inquiry_text')->value('not_use_probability');
|
|
|
|
$randomNumber = rand(0, 100);
|
|
|
|
if($randomNumber < $not_use_probability){
|
|
|
|
//原内容非英语,转为对应语种
|
|
|
|
if (is_numeric($form_message)) { //数字会被识别为中文
|
|
|
|
$lang = 'en';
|
|
...
|
...
|
@@ -612,6 +619,7 @@ class RelayInquiry extends Command |
|
|
|
}
|
|
|
|
return [$message, $message_id, $lang??''];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//开启文案替换
|
|
|
|
if ($task['is_replace_text'] == 2) {
|
...
|
...
|
|