|
...
|
...
|
@@ -4,6 +4,8 @@ |
|
|
|
namespace App\Services;
|
|
|
|
|
|
|
|
use App\Exceptions\InquiryFilterException;
|
|
|
|
use App\Models\Domain\CountryCode;
|
|
|
|
use App\Models\Domain\DomainInfo;
|
|
|
|
use App\Models\Inquiry\InquiryForm;
|
|
|
|
use App\Models\Inquiry\InquiryFormData;
|
|
|
|
use App\Models\Project\AutoEmail;
|
|
...
|
...
|
@@ -71,6 +73,20 @@ class SyncSubmitTaskService |
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//域名 过滤国家或ip
|
|
|
|
$domain_info = DomainInfo::where('project_id', $project['id'])->first();
|
|
|
|
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;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if(!empty($domain_info['not_allow_ip'])){
|
|
|
|
if(in_array($data['ip'], $domain_info['not_allow_ip'])){
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if(!ProjectServer::useProject($project['id'])){
|
|
|
|
return false;
|
|
|
|
}
|
|
...
|
...
|
@@ -91,7 +107,7 @@ class SyncSubmitTaskService |
|
|
|
}
|
|
|
|
|
|
|
|
$handler = new self();
|
|
|
|
return $handler->$action($data, $date, $task['id']);
|
|
|
|
return $handler->$action($data, $date, $task['id'], $task['traffic']);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
...
|
...
|
@@ -122,7 +138,7 @@ class SyncSubmitTaskService |
|
|
|
* @author zbj
|
|
|
|
* @date 2024/8/27
|
|
|
|
*/
|
|
|
|
public function subscribe($data, $date, $task_id){
|
|
|
|
public function subscribe($data, $date, $task_id, $traffic = 0){
|
|
|
|
$email = $data['data']['email'];
|
|
|
|
if (filter_var($email, FILTER_VALIDATE_EMAIL)) {
|
|
|
|
$model = Email::where('email', $email)->first();
|
|
...
|
...
|
@@ -170,7 +186,7 @@ class SyncSubmitTaskService |
|
|
|
* @author zbj
|
|
|
|
* @date 2023/12/4
|
|
|
|
*/
|
|
|
|
public function inquiry($data, $date, $task_id)
|
|
|
|
public function inquiry($data, $date, $task_id, $traffic = 0)
|
|
|
|
{
|
|
|
|
//数组key转为小写
|
|
|
|
$data['data'] = array_change_key_case($data['data'], CASE_LOWER);
|
|
...
|
...
|
@@ -194,7 +210,7 @@ class SyncSubmitTaskService |
|
|
|
|
|
|
|
$data['referer'] = $this->handle_referer($data['referer']);
|
|
|
|
|
|
|
|
$id = InquiryFormData::saveData($form_id, $data['domain'], $data['ip'], $data['country'], $data['referer'], $data['user_agent'], $data['submit_at'], $data['data']);
|
|
|
|
$id = InquiryFormData::saveData($form_id, $data['domain'], $data['ip'], $data['country'], $data['referer'], $data['user_agent'], $data['submit_at'], $data['data'], $traffic);
|
|
|
|
|
|
|
|
|
|
|
|
//转化询盘
|
|
...
|
...
|
@@ -224,7 +240,7 @@ class SyncSubmitTaskService |
|
|
|
* @author zbj
|
|
|
|
* @date 2023/12/4
|
|
|
|
*/
|
|
|
|
public function visit($data, $date, $task_id)
|
|
|
|
public function visit($data, $date, $task_id, $traffic = 0)
|
|
|
|
{
|
|
|
|
|
|
|
|
$visit_data = $data['data'];
|
...
|
...
|
|