master
cody 2 weeks ago
parent 6d1f69ac33
commit 51fae3d762

@ -95,9 +95,8 @@ class OtherController extends CommonController
} }
$YuanheRepository = new YuanheRepository(); $YuanheRepository = new YuanheRepository();
$result = $YuanheRepository->search(['keyword' => $all['company_name']]); $result = $YuanheRepository->search(['keyword' => $all['company_name']]);
$result = json_decode($result, true); if (empty($result)) {
if (!$result) { return $this->fail([ResponseCode::ERROR_PARAMETER, '无数据']);
return $this->fail([ResponseCode::ERROR_PARAMETER, '获取失败']);
} }
$list = []; $list = [];
foreach ($result as $item) { foreach ($result as $item) {

@ -73,10 +73,10 @@ class YuanheRepository
if ($result['code'] == 200) { if ($result['code'] == 200) {
return $result['data']; return $result['data'];
} else { } else {
return false; return [];
} }
} catch (\Exception $e) { } catch (\Exception $e) {
return false; return [];
} }
} }

Loading…
Cancel
Save