作者 赵彬吉

update

... ... @@ -53,7 +53,7 @@ class SyncSubmitTaskService
//特殊处理
if($project['id'] == 455 && !empty($data['email']) && $data['email'] == 'alb@marketingtu.org'){
return false;
throw new InquiryFilterException( '黑名单邮箱');
}
//过滤url参数 清除全部参数
... ... @@ -69,8 +69,9 @@ class SyncSubmitTaskService
if ($data['country'] == '约旦' && empty($data['data']['referrer_url'])) {
$url_array = parse_url($data['data']['url']);
$path_array = explode('/', $url_array['path']);
if (FALSE == empty($path_array[1]) && strlen($path_array[1]) <= 3)
return false;
if (FALSE == empty($path_array[1]) && strlen($path_array[1]) <= 3){
throw new InquiryFilterException( '过滤被刷访问');
}
}
}
... ... @@ -79,18 +80,18 @@ class SyncSubmitTaskService
if(!empty($domain_info['not_allow_country'])){
$not_allow_countries = CountryCode::whereIn('id', $domain_info['not_allow_country'])->pluck('c_name')->toArray();
if(in_array($data['country'], $not_allow_countries)){
return false;
throw new InquiryFilterException( '过滤国家');
}
}
if(!empty($domain_info['not_allow_ip'])){
if(in_array($data['ip'], $domain_info['not_allow_ip'])){
return false;
throw new InquiryFilterException( '过滤ip');
}
}
$time = time();
if(!ProjectServer::useProject($project['id'])){
return false;
throw new InquiryFilterException( '项目不存在或数据库配置异常');
}
echo date('Y-m-d H:i:s') . ' | useProject time:' . (time() - $time) . PHP_EOL;
... ... @@ -108,7 +109,7 @@ class SyncSubmitTaskService
}
$filed == 'email' && $action = 'subscribe';
}
$handler = new self();
return $handler->$action($data, $date, $task['id'], $task['traffic']);
}
... ... @@ -204,7 +205,7 @@ class SyncSubmitTaskService
}
if(Cache::get($ip_lock_cache_key)){
Log::channel('inquiry')->info($task_id . '询盘ip重复锁定', [$data]);
return true;
throw new InquiryFilterException( 'ip半小时内重复询盘');
}
//数组key转为小写
... ...