Commit 0a5b65ab by 杨树贤

兼容try

parent f502f700
Showing with 12 additions and 8 deletions
...@@ -17,16 +17,20 @@ class CrmService ...@@ -17,16 +17,20 @@ class CrmService
return json_decode($cachedData, true); return json_decode($cachedData, true);
} }
$url = env('CRM_URL') . '/open/signComs/getSignComs?use_scope=2'; try {
$client = new Client(); $url = env('CRM_URL') . '/open/signComs/getSignComs?use_scope=2';
$response = $client->get($url); $client = new Client();
$result = json_decode($response->getBody()->getContents(), true); $response = $client->get($url);
if ($result['code'] != 0) { $result = json_decode($response->getBody()->getContents(), true);
if ($result['code'] != 0) {
return [];
}
(new RedisModel())->setex($cacheKey, 60, json_encode($result['data']['list']));
return $result['data']['list'];
} catch (\Exception $e) {
return []; return [];
} }
(new RedisModel())->setex($cacheKey, 60, json_encode($result['data']['list']));
return $result['data']['list'];
} }
//获取简单形式给各个地方使用 //获取简单形式给各个地方使用
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment