作者 赵彬吉

update

@@ -116,17 +116,17 @@ class postInquiry extends Command @@ -116,17 +116,17 @@ class postInquiry extends Command
116 } 116 }
117 }else{ 117 }else{
118 //v4 v5分离项目 往测试链接推 118 //v4 v5分离项目 往测试链接推
119 - $split_api_cache_key = 'extend_api_saas_split';  
120 - $mail_urls = Cache::get($split_api_cache_key);  
121 - if(!$mail_urls){ 119 + $split_api_cache_key = 'quanqiusou_split_site_array';
  120 + $site_array = Cache::get($split_api_cache_key);
  121 + if(!$site_array){
122 $client = new \GuzzleHttp\Client(); 122 $client = new \GuzzleHttp\Client();
123 $site_array = $client->request('GET', "https://www.quanqiusou.cn/extend_api/saas/split.php", [ 123 $site_array = $client->request('GET', "https://www.quanqiusou.cn/extend_api/saas/split.php", [
124 'proxy' => env('CURL_PROXY'), // 代理服务器地址和端口号 124 'proxy' => env('CURL_PROXY'), // 代理服务器地址和端口号
125 ])->getBody()->getContents(); 125 ])->getBody()->getContents();
126 $site_array = json_decode($site_array, true); 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); 127 + Cache::put($split_api_cache_key, $site_array, 7200);
129 } 128 }
  129 + $mail_urls = array_column($site_array, 'main_url');
130 $key = array_search($website, $mail_urls); 130 $key = array_search($website, $mail_urls);
131 if ($key !== false) { 131 if ($key !== false) {
132 // 分离项目 推送到测试链接 132 // 分离项目 推送到测试链接
@@ -201,7 +201,7 @@ class postInquiry extends Command @@ -201,7 +201,7 @@ class postInquiry extends Command
201 //兼容接口返回格式 201 //兼容接口返回格式
202 if(!empty($res['data'][0]['status'])){ 202 if(!empty($res['data'][0]['status'])){
203 $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']; 204 + !empty($res['data'][0]['msg']) && $res['message'] = $res['data'][0]['msg'];
205 } 205 }
206 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])){
207 $log->status = ReInquiryDetailLog::STATUS_FAIL; 207 $log->status = ReInquiryDetailLog::STATUS_FAIL;