|
@@ -4,6 +4,8 @@ |
|
@@ -4,6 +4,8 @@ |
|
4
|
namespace App\Services;
|
4
|
namespace App\Services;
|
|
5
|
|
5
|
|
|
6
|
use App\Exceptions\InquiryFilterException;
|
6
|
use App\Exceptions\InquiryFilterException;
|
|
|
|
7
|
+use App\Models\Domain\CountryCode;
|
|
|
|
8
|
+use App\Models\Domain\DomainInfo;
|
|
7
|
use App\Models\Inquiry\InquiryForm;
|
9
|
use App\Models\Inquiry\InquiryForm;
|
|
8
|
use App\Models\Inquiry\InquiryFormData;
|
10
|
use App\Models\Inquiry\InquiryFormData;
|
|
9
|
use App\Models\Project\AutoEmail;
|
11
|
use App\Models\Project\AutoEmail;
|
|
@@ -71,6 +73,20 @@ class SyncSubmitTaskService |
|
@@ -71,6 +73,20 @@ class SyncSubmitTaskService |
|
71
|
}
|
73
|
}
|
|
72
|
}
|
74
|
}
|
|
73
|
|
75
|
|
|
|
|
76
|
+ //域名 过滤国家或ip
|
|
|
|
77
|
+ $domain_info = DomainInfo::where('project_id', $project['id'])->first();
|
|
|
|
78
|
+ if(!empty($domain_info['not_allow_country'])){
|
|
|
|
79
|
+ $not_allow_countries = CountryCode::whereIn('id', $domain_info['not_allow_country'])->pluck('c_name')->toArray();
|
|
|
|
80
|
+ if(in_array($data['country'], $not_allow_countries)){
|
|
|
|
81
|
+ return false;
|
|
|
|
82
|
+ }
|
|
|
|
83
|
+ }
|
|
|
|
84
|
+ if(!empty($domain_info['not_allow_ip'])){
|
|
|
|
85
|
+ if(in_array($data['ip'], $domain_info['not_allow_ip'])){
|
|
|
|
86
|
+ return false;
|
|
|
|
87
|
+ }
|
|
|
|
88
|
+ }
|
|
|
|
89
|
+
|
|
74
|
if(!ProjectServer::useProject($project['id'])){
|
90
|
if(!ProjectServer::useProject($project['id'])){
|
|
75
|
return false;
|
91
|
return false;
|
|
76
|
}
|
92
|
}
|
|
@@ -91,7 +107,7 @@ class SyncSubmitTaskService |
|
@@ -91,7 +107,7 @@ class SyncSubmitTaskService |
|
91
|
}
|
107
|
}
|
|
92
|
|
108
|
|
|
93
|
$handler = new self();
|
109
|
$handler = new self();
|
|
94
|
- return $handler->$action($data, $date, $task['id']);
|
110
|
+ return $handler->$action($data, $date, $task['id'], $task['traffic']);
|
|
95
|
}
|
111
|
}
|
|
96
|
|
112
|
|
|
97
|
|
113
|
|
|
@@ -122,7 +138,7 @@ class SyncSubmitTaskService |
|
@@ -122,7 +138,7 @@ class SyncSubmitTaskService |
|
122
|
* @author zbj
|
138
|
* @author zbj
|
|
123
|
* @date 2024/8/27
|
139
|
* @date 2024/8/27
|
|
124
|
*/
|
140
|
*/
|
|
125
|
- public function subscribe($data, $date, $task_id){
|
141
|
+ public function subscribe($data, $date, $task_id, $traffic = 0){
|
|
126
|
$email = $data['data']['email'];
|
142
|
$email = $data['data']['email'];
|
|
127
|
if (filter_var($email, FILTER_VALIDATE_EMAIL)) {
|
143
|
if (filter_var($email, FILTER_VALIDATE_EMAIL)) {
|
|
128
|
$model = Email::where('email', $email)->first();
|
144
|
$model = Email::where('email', $email)->first();
|
|
@@ -170,7 +186,7 @@ class SyncSubmitTaskService |
|
@@ -170,7 +186,7 @@ class SyncSubmitTaskService |
|
170
|
* @author zbj
|
186
|
* @author zbj
|
|
171
|
* @date 2023/12/4
|
187
|
* @date 2023/12/4
|
|
172
|
*/
|
188
|
*/
|
|
173
|
- public function inquiry($data, $date, $task_id)
|
189
|
+ public function inquiry($data, $date, $task_id, $traffic = 0)
|
|
174
|
{
|
190
|
{
|
|
175
|
//数组key转为小写
|
191
|
//数组key转为小写
|
|
176
|
$data['data'] = array_change_key_case($data['data'], CASE_LOWER);
|
192
|
$data['data'] = array_change_key_case($data['data'], CASE_LOWER);
|
|
@@ -194,7 +210,7 @@ class SyncSubmitTaskService |
|
@@ -194,7 +210,7 @@ class SyncSubmitTaskService |
|
194
|
|
210
|
|
|
195
|
$data['referer'] = $this->handle_referer($data['referer']);
|
211
|
$data['referer'] = $this->handle_referer($data['referer']);
|
|
196
|
|
212
|
|
|
197
|
- $id = InquiryFormData::saveData($form_id, $data['domain'], $data['ip'], $data['country'], $data['referer'], $data['user_agent'], $data['submit_at'], $data['data']);
|
213
|
+ $id = InquiryFormData::saveData($form_id, $data['domain'], $data['ip'], $data['country'], $data['referer'], $data['user_agent'], $data['submit_at'], $data['data'], $traffic);
|
|
198
|
|
214
|
|
|
199
|
|
215
|
|
|
200
|
//转化询盘
|
216
|
//转化询盘
|
|
@@ -224,7 +240,7 @@ class SyncSubmitTaskService |
|
@@ -224,7 +240,7 @@ class SyncSubmitTaskService |
|
224
|
* @author zbj
|
240
|
* @author zbj
|
|
225
|
* @date 2023/12/4
|
241
|
* @date 2023/12/4
|
|
226
|
*/
|
242
|
*/
|
|
227
|
- public function visit($data, $date, $task_id)
|
243
|
+ public function visit($data, $date, $task_id, $traffic = 0)
|
|
228
|
{
|
244
|
{
|
|
229
|
|
245
|
|
|
230
|
$visit_data = $data['data'];
|
246
|
$visit_data = $data['data'];
|