作者 赵彬吉

update

... ... @@ -6,6 +6,7 @@ namespace App\Helper;
use App\Models\Project\Project;
use App\Utils\HttpUtils;
use GuzzleHttp\Exception\GuzzleException;
use Illuminate\Support\Facades\Log;
/**
... ... @@ -154,7 +155,7 @@ class FormGlobalsoApi
$res = HttpUtils::post($api_url, $data);
$res = Arr::s2a($res);
} catch (\Exception | GuzzleException $e) {
errorLog('提交询盘信息失败', $data, $e);
Log::channel('inquiry')->info('询盘发送邮件失败' . $e->getMessage(), $data);
return false;
}
return $res;
... ...
... ... @@ -66,19 +66,6 @@ class InquiryFormData extends Base
return 0;
}
$model = new self();
$model->form_id = $form_id;
$model->domain = $domain;
$model->ip = $ip;
$model->country = $country;
$model->referer = $referer;
$model->user_agent = $user_agent;
$model->submit_at = $submit_at;
$model->data = $data;
$model->sign = $sign;
$model->save();
if(!empty($data['name']) && !empty($data['email']) && !empty($data['message'])){
Log::channel('inquiry')->info('开始发邮件' . PHP_EOL);
... ... @@ -102,8 +89,24 @@ class InquiryFormData extends Base
if(!$has_file) {
$res = (new FormGlobalsoApi())->submitInquiry($ip, $referer, $submit_at, $data, $traffic);
Log::channel('inquiry')->info('询盘发送邮件', [$data, $res]);
if(!$res){
throw new \Exception('询盘发送邮件失败');
}
}
}
$model = new self();
$model->form_id = $form_id;
$model->domain = $domain;
$model->ip = $ip;
$model->country = $country;
$model->referer = $referer;
$model->user_agent = $user_agent;
$model->submit_at = $submit_at;
$model->data = $data;
$model->sign = $sign;
$model->save();
return $model->id;
}
... ...
... ... @@ -68,6 +68,11 @@ class SyncSubmitTaskService
$project = $checkIpCountry['project'];
$data['project_id'] = $project['id'];
if(empty($data['data']['url']) && $task['type'] == 'visit'){
throw new InquiryFilterException( 'url为空');
}
//特殊处理
if($project['id'] == 455 && !empty($data['email']) && $data['email'] == 'alb@marketingtu.org'){
throw new InquiryFilterException( '黑名单邮箱');
... ...