From 7a03dd90e54704ba731dec50ff3d3ddd0d739a01 Mon Sep 17 00:00:00 2001 From: cody <648753004@qq.com> Date: Thu, 28 Aug 2025 13:39:47 +0800 Subject: [PATCH] update --- app/Console/Commands/UpdateCompany.php | 4 -- .../Controllers/Mobile/OtherController.php | 52 +++---------------- app/Repositories/YuanheRepository.php | 20 +++++++ 3 files changed, 27 insertions(+), 49 deletions(-) diff --git a/app/Console/Commands/UpdateCompany.php b/app/Console/Commands/UpdateCompany.php index f7c8833..5366835 100755 --- a/app/Console/Commands/UpdateCompany.php +++ b/app/Console/Commands/UpdateCompany.php @@ -42,10 +42,6 @@ class UpdateCompany extends Command */ public function handle() { -// $YuanheRepository = new YuanheRepository(); -// $result = $YuanheRepository->companyInfo(['keyword' => '苏州元瞰科技有限公司','enterpriseName'=>'博世工程技术']); -// dd($result); - $user_id = $this->option('user_id'); // 更新公司信息 $this->compnay($user_id); diff --git a/app/Http/Controllers/Mobile/OtherController.php b/app/Http/Controllers/Mobile/OtherController.php index 33a1f5a..90fc56c 100755 --- a/app/Http/Controllers/Mobile/OtherController.php +++ b/app/Http/Controllers/Mobile/OtherController.php @@ -91,47 +91,9 @@ class OtherController extends CommonController return $this->fail([ResponseCode::ERROR_PARAMETER, implode(',', $validator->errors()->all())]); } $YuanheRepository = new YuanheRepository(); - // $result = $YuanheRepository->companyInfo(['enterpriseName' => $all['company_name']]); - $result[] = [ - "createBy" => null, - "createDt" => null, - "updateBy" => null, - "updateDt" => null, - "enterpriseId" => "1950060660573786112", - "enterpriseName" => "苏州元瞰科技有限公司", - "creditCode" => "91320594MA7F0G9W6A", - "keyNo" => "db5ppy5kbsprbbhjbjlarvmvphjhp3mrkv", - "isAbroad" => "0", - "status" => "注销", - "logo" => "https://image.qcc.com/logo/EntImage.png", - "operName" => "刘杰杰", - "contactMail" => "425039148@qq.com", - "contactPhone" => "15298866552", - "startDate" => "2021-12-21", - "endDate" => null, - "updatedDate" => "2025-08-17", - "registCapi" => "100万元", - "registAmount" => "1000000.0000", - "registCapiType" => "1", - "currencyType" => null, - "termStart" => "2021-12-21", - "termEnd" => null, - "checkDate" => "2025-07-03", - "orgNo" => "MA7F0G9W-6", - "isOnStock" => "0", - "stockNumber" => "", - "stockType" => "", - "stockDate" => null, - "province" => "江苏省", - "city" => "苏州市", - "country" => "苏州工业园区", - "areaCode" => "320576", - "address" => "苏州工业园区亭新街11号B1栋二楼", - "businessScope" => "一般项目:人工智能应用软件开发", - "tagList" => null, - "qccIndustry" => null, - "isYhInvested" => false - ]; + // $result = $YuanheRepository->search(['keyword' => $all['company_name']]); + $result = "[{\"createBy\":null,\"createDt\":null,\"updateBy\":null,\"updateDt\":null,\"creditCode\":\"91320594MA7F0G9W6A\",\"keyNo\":\"db5ppy5kbsprbbhjbjlarvmvphjhp3mrkv\",\"name\":\"苏州元瞰科技有限公司\",\"operName\":\"刘杰杰\",\"startDate\":\"2021-12-21\",\"status\":\"注销\"},{\"createBy\":null,\"createDt\":null,\"updateBy\":null,\"updateDt\":null,\"creditCode\":\"91310118MA1JMYNK9K\",\"keyNo\":\"ak95iy5s3rhmsasj5kepiijjimh95jl3b5\",\"name\":\"上海元橡瞰行科技有限公司\",\"operName\":\"任杰\",\"startDate\":\"2019-03-19\",\"status\":\"存续\"},{\"createBy\":null,\"createDt\":null,\"updateBy\":null,\"updateDt\":null,\"creditCode\":\"91110108MAERYU4T74\",\"keyNo\":\"fs3ijyphhk59kbhjblbsj35priklbla5vh\",\"name\":\"北京元字瞰科技有限公司\",\"operName\":\"宋明龙\",\"startDate\":\"2025-08-22\",\"status\":\"存续\"},{\"createBy\":null,\"createDt\":null,\"updateBy\":null,\"updateDt\":null,\"creditCode\":\"\",\"keyNo\":\"13ivbylse5l5mjkjar9pbhkm9vpsjiksjl\",\"name\":\"上海瞰元信息科技有限公司\",\"operName\":\"刘勇\",\"startDate\":\"2005-06-30\",\"status\":\"吊销\"},{\"createBy\":null,\"createDt\":null,\"updateBy\":null,\"updateDt\":null,\"creditCode\":\"91330100796660273A\",\"keyNo\":\"f3aaeyiss99ev5hjbipkv9eaerkih99bbs\",\"name\":\"杭州瞰元信息科技有限公司\",\"operName\":\"曾铁农\",\"startDate\":\"2006-12-22\",\"status\":\"吊销\"}]\""; + $result = json_decode($result, true); if (!$result) { return $this->fail([ResponseCode::ERROR_PARAMETER, '获取失败']); } @@ -180,10 +142,10 @@ class OtherController extends CommonController // 使用 Haversine 公式计算距离 $distanceFormula = " (6371 * acos( - cos(radians(?)) * - cos(radians(CAST(company_latitude AS DECIMAL(10,8)))) * - cos(radians(CAST(company_longitude AS DECIMAL(10,8))) - radians(?)) + - sin(radians(?)) * + cos(radians(?)) * + cos(radians(CAST(company_latitude AS DECIMAL(10,8)))) * + cos(radians(CAST(company_longitude AS DECIMAL(10,8))) - radians(?)) + + sin(radians(?)) * sin(radians(CAST(company_latitude AS DECIMAL(10,8)))) )) AS distance "; diff --git a/app/Repositories/YuanheRepository.php b/app/Repositories/YuanheRepository.php index 9da24e5..a2ee1e5 100755 --- a/app/Repositories/YuanheRepository.php +++ b/app/Repositories/YuanheRepository.php @@ -61,6 +61,26 @@ class YuanheRepository } } + /** + * 公司模糊查询 + */ + public function search($params) + { + $url = $this->baseUrl . '/master-service/openapi/businessCollege/enterprise/search'; + $header = $this->getHeader(); + try { + $result = httpCurl($url, 'GET', $params, $header); + $result = json_decode($result, true); + if ($result['code'] == 200) { + return $result['data']; + } else { + return false; + } + } catch (\Exception $e) { + return false; + } + } + /** * 数据推送 */