作者 赵彬吉

update

@@ -53,7 +53,7 @@ class SyncSubmitTaskService @@ -53,7 +53,7 @@ class SyncSubmitTaskService
53 53
54 //特殊处理 54 //特殊处理
55 if($project['id'] == 455 && !empty($data['email']) && $data['email'] == 'alb@marketingtu.org'){ 55 if($project['id'] == 455 && !empty($data['email']) && $data['email'] == 'alb@marketingtu.org'){
56 - return false; 56 + throw new InquiryFilterException( '黑名单邮箱');
57 } 57 }
58 58
59 //过滤url参数 清除全部参数 59 //过滤url参数 清除全部参数
@@ -69,8 +69,9 @@ class SyncSubmitTaskService @@ -69,8 +69,9 @@ class SyncSubmitTaskService
69 if ($data['country'] == '约旦' && empty($data['data']['referrer_url'])) { 69 if ($data['country'] == '约旦' && empty($data['data']['referrer_url'])) {
70 $url_array = parse_url($data['data']['url']); 70 $url_array = parse_url($data['data']['url']);
71 $path_array = explode('/', $url_array['path']); 71 $path_array = explode('/', $url_array['path']);
72 - if (FALSE == empty($path_array[1]) && strlen($path_array[1]) <= 3)  
73 - return false; 72 + if (FALSE == empty($path_array[1]) && strlen($path_array[1]) <= 3){
  73 + throw new InquiryFilterException( '过滤被刷访问');
  74 + }
74 } 75 }
75 } 76 }
76 77
@@ -79,18 +80,18 @@ class SyncSubmitTaskService @@ -79,18 +80,18 @@ class SyncSubmitTaskService
79 if(!empty($domain_info['not_allow_country'])){ 80 if(!empty($domain_info['not_allow_country'])){
80 $not_allow_countries = CountryCode::whereIn('id', $domain_info['not_allow_country'])->pluck('c_name')->toArray(); 81 $not_allow_countries = CountryCode::whereIn('id', $domain_info['not_allow_country'])->pluck('c_name')->toArray();
81 if(in_array($data['country'], $not_allow_countries)){ 82 if(in_array($data['country'], $not_allow_countries)){
82 - return false; 83 + throw new InquiryFilterException( '过滤国家');
83 } 84 }
84 } 85 }
85 if(!empty($domain_info['not_allow_ip'])){ 86 if(!empty($domain_info['not_allow_ip'])){
86 if(in_array($data['ip'], $domain_info['not_allow_ip'])){ 87 if(in_array($data['ip'], $domain_info['not_allow_ip'])){
87 - return false; 88 + throw new InquiryFilterException( '过滤ip');
88 } 89 }
89 } 90 }
90 91
91 $time = time(); 92 $time = time();
92 if(!ProjectServer::useProject($project['id'])){ 93 if(!ProjectServer::useProject($project['id'])){
93 - return false; 94 + throw new InquiryFilterException( '项目不存在或数据库配置异常');
94 } 95 }
95 echo date('Y-m-d H:i:s') . ' | useProject time:' . (time() - $time) . PHP_EOL; 96 echo date('Y-m-d H:i:s') . ' | useProject time:' . (time() - $time) . PHP_EOL;
96 97
@@ -108,7 +109,7 @@ class SyncSubmitTaskService @@ -108,7 +109,7 @@ class SyncSubmitTaskService
108 } 109 }
109 $filed == 'email' && $action = 'subscribe'; 110 $filed == 'email' && $action = 'subscribe';
110 } 111 }
111 - 112 +
112 $handler = new self(); 113 $handler = new self();
113 return $handler->$action($data, $date, $task['id'], $task['traffic']); 114 return $handler->$action($data, $date, $task['id'], $task['traffic']);
114 } 115 }
@@ -204,7 +205,7 @@ class SyncSubmitTaskService @@ -204,7 +205,7 @@ class SyncSubmitTaskService
204 } 205 }
205 if(Cache::get($ip_lock_cache_key)){ 206 if(Cache::get($ip_lock_cache_key)){
206 Log::channel('inquiry')->info($task_id . '询盘ip重复锁定', [$data]); 207 Log::channel('inquiry')->info($task_id . '询盘ip重复锁定', [$data]);
207 - return true; 208 + throw new InquiryFilterException( 'ip半小时内重复询盘');
208 } 209 }
209 210
210 //数组key转为小写 211 //数组key转为小写