作者 赵彬吉

update

@@ -593,7 +593,7 @@ class RelayInquiry extends Command @@ -593,7 +593,7 @@ class RelayInquiry extends Command
593 } 593 }
594 $translateSl = Translate::translateSl($incontent); 594 $translateSl = Translate::translateSl($incontent);
595 $lang = $translateSl['texts']['sl'] ?? 'en'; 595 $lang = $translateSl['texts']['sl'] ?? 'en';
596 - if ($lang == 'en' || Str::contains($lang, 'zh')) { 596 + if ($lang == 'en' || $lang == 'ja' || $lang == 'ko' || Str::contains($lang, 'zh')) {
597 $language = '英文'; 597 $language = '英文';
598 $lang = 'en'; 598 $lang = 'en';
599 }else{ 599 }else{
@@ -6,6 +6,7 @@ use App\Models\Inquiry\ReInquiryDetail; @@ -6,6 +6,7 @@ use App\Models\Inquiry\ReInquiryDetail;
6 use App\Models\Inquiry\ReInquiryDetailLog; 6 use App\Models\Inquiry\ReInquiryDetailLog;
7 use App\Models\Inquiry\ReInquiryForm; 7 use App\Models\Inquiry\ReInquiryForm;
8 use Illuminate\Console\Command; 8 use Illuminate\Console\Command;
  9 +use Illuminate\Support\Facades\Cache;
9 use Illuminate\Support\Facades\Http; 10 use Illuminate\Support\Facades\Http;
10 use Illuminate\Support\Facades\Log; 11 use Illuminate\Support\Facades\Log;
11 use Illuminate\Support\Facades\Redis; 12 use Illuminate\Support\Facades\Redis;
@@ -115,12 +116,17 @@ class postInquiry extends Command @@ -115,12 +116,17 @@ class postInquiry extends Command
115 } 116 }
116 }else{ 117 }else{
117 //v4 v5分离项目 往测试链接推 118 //v4 v5分离项目 往测试链接推
118 - $client = new \GuzzleHttp\Client();  
119 - $site_array = $client->request('GET', "https://www.quanqiusou.cn/extend_api/saas/split.php", [  
120 - 'proxy' => env('CURL_PROXY'), // 代理服务器地址和端口号  
121 - ])->getBody()->getContents();  
122 - $site_array = json_decode($site_array, true);  
123 - $mail_urls = array_column($site_array, 'main_url'); 119 + $split_api_cache_key = 'extend_api_saas_split';
  120 + $mail_urls = Cache::get($split_api_cache_key);
  121 + if(!$mail_urls){
  122 + $client = new \GuzzleHttp\Client();
  123 + $site_array = $client->request('GET', "https://www.quanqiusou.cn/extend_api/saas/split.php", [
  124 + 'proxy' => env('CURL_PROXY'), // 代理服务器地址和端口号
  125 + ])->getBody()->getContents();
  126 + $site_array = json_decode($site_array, true);
  127 + $mail_urls = array_column($site_array, 'main_url');
  128 + Cache::put($split_api_cache_key, $mail_urls, 7200);
  129 + }
124 $key = array_search($website, $mail_urls); 130 $key = array_search($website, $mail_urls);
125 if ($key !== false) { 131 if ($key !== false) {
126 // 分离项目 推送到测试链接 132 // 分离项目 推送到测试链接
@@ -195,6 +201,7 @@ class postInquiry extends Command @@ -195,6 +201,7 @@ class postInquiry extends Command
195 //兼容接口返回格式 201 //兼容接口返回格式
196 if(!empty($res['data'][0]['status'])){ 202 if(!empty($res['data'][0]['status'])){
197 $res['data'][0]['code'] = $res['data'][0]['status'] == 'success' ? 200 : 400; 203 $res['data'][0]['code'] = $res['data'][0]['status'] == 'success' ? 200 : 400;
  204 + $res['message'] = $res['data'][0]['msg'];
198 } 205 }
199 if(empty($res['data'][0]['code']) || !in_array($res['data'][0]['code'], [200,300])){ 206 if(empty($res['data'][0]['code']) || !in_array($res['data'][0]['code'], [200,300])){
200 $log->status = ReInquiryDetailLog::STATUS_FAIL; 207 $log->status = ReInquiryDetailLog::STATUS_FAIL;