作者 赵彬吉

update

@@ -75,23 +75,19 @@ class InquiryFormData extends Base @@ -75,23 +75,19 @@ class InquiryFormData extends Base
75 unset($data['globalso-date']); 75 unset($data['globalso-date']);
76 76
77 //推送邮件发送 77 //推送邮件发送
78 - $has_file = false;  
79 foreach ($data as $k => $v){ 78 foreach ($data as $k => $v){
80 - if(is_array($v)){  
81 - $has_file = true;  
82 - break; 79 + if(is_array($v) && !empty($v['path'])){
  80 + $data[$k] = getImageUrl($v['path']);
83 } 81 }
84 //其他字段补充到message里 82 //其他字段补充到message里
85 if(!in_array($k, ['name', 'email', 'message', 'phone', 'ip', 'date', 'cname', 'domain', 'edition', 'domain_host_url'])){ 83 if(!in_array($k, ['name', 'email', 'message', 'phone', 'ip', 'date', 'cname', 'domain', 'edition', 'domain_host_url'])){
86 $data['message'].= "<br/>" . $k .': ' . $v; 84 $data['message'].= "<br/>" . $k .': ' . $v;
87 } 85 }
88 } 86 }
89 - if(!$has_file) {  
90 - $res = (new FormGlobalsoApi())->submitInquiry($ip, $referer, $submit_at, $data, $traffic);  
91 - Log::channel('inquiry')->info('询盘发送邮件', [$data, $res]);  
92 - if(!$res){  
93 - throw new \Exception('询盘发送邮件失败');  
94 - } 87 + $res = (new FormGlobalsoApi())->submitInquiry($ip, $referer, $submit_at, $data, $traffic);
  88 + Log::channel('inquiry')->info('询盘发送邮件', [$data, $res]);
  89 + if(!$res){
  90 + throw new \Exception('询盘发送邮件失败');
95 } 91 }
96 } 92 }
97 93