作者 赵彬吉

fb询盘多ip访问

... ... @@ -171,6 +171,12 @@ class RelayInquiry extends Command
protected $filter_phone = [30,12,58];
/**
* 需要多个ip访问的国家
* @var
*/
protected $multiple_ip_visit_country = [];
/**
* @return bool
*/
public function handle()
... ... @@ -224,7 +230,16 @@ 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]); //第几次询盘
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);
}
... ... @@ -287,7 +302,7 @@ class RelayInquiry extends Command
* @param $form
* @return bool
*/
public function relayDetail($task, $form)
public function relayDetail($task, $form, $is_inquiry = true)
{
$this->output('获取转发对象');
if(empty($task['target'] )){
... ... @@ -361,7 +376,7 @@ class RelayInquiry extends Command
$pre = 0;
$start_time = time();
$seconds = rand(300, 3000); // 开始时间 从5-50分钟后开始
$seconds = rand(300, 7200); // 开始时间 从5-2小时后开始
$exists = ReInquiryDetail::where('re_website', $domain)->where('email', $form->email)->first();
if($exists){
$this->output('转发站点邮件已存在');
... ... @@ -375,7 +390,7 @@ class RelayInquiry extends Command
$seconds += rand(5,60);
ReInquiryDetailLog::createInquiryLog($re_detail->id, ReInquiryDetailLog::TYPE_VISIT, $pre, $v, date('Y-m-d H:i:s', $start_time + $seconds));
// 最后一次访问询盘 加上询盘
if($k+1 >= count($urls)){
if($is_inquiry && $k+1 >= count($urls)){
$seconds += rand(30,120);
$pre++;
ReInquiryDetailLog::createInquiryLog($re_detail->id, ReInquiryDetailLog::TYPE_INQUIRY, $pre, $v, date('Y-m-d H:i:s', $start_time + $seconds));
... ...