|
@@ -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分离项目 往测试链接推
|
|
|
|
119
|
+ $split_api_cache_key = 'extend_api_saas_split';
|
|
|
|
120
|
+ $mail_urls = Cache::get($split_api_cache_key);
|
|
|
|
121
|
+ if(!$mail_urls){
|
|
118
|
$client = new \GuzzleHttp\Client();
|
122
|
$client = new \GuzzleHttp\Client();
|
|
119
|
$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", [
|
|
120
|
'proxy' => env('CURL_PROXY'), // 代理服务器地址和端口号
|
124
|
'proxy' => env('CURL_PROXY'), // 代理服务器地址和端口号
|
|
121
|
])->getBody()->getContents();
|
125
|
])->getBody()->getContents();
|
|
122
|
$site_array = json_decode($site_array, true);
|
126
|
$site_array = json_decode($site_array, true);
|
|
123
|
$mail_urls = array_column($site_array, 'main_url');
|
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;
|