From b000a00504bfce7b84802d6db067905538050030 Mon Sep 17 00:00:00 2001 From: mkm <727897186@qq.com> Date: Thu, 20 Jul 2023 14:58:08 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/adminapi/controller/CompanyController.php | 25 ++++++------- app/api/controller/Hetong.php | 35 +++++++++++++++++++ 2 files changed, 48 insertions(+), 12 deletions(-) create mode 100644 app/api/controller/Hetong.php diff --git a/app/adminapi/controller/CompanyController.php b/app/adminapi/controller/CompanyController.php index 7f627444a..9f4ad90d0 100644 --- a/app/adminapi/controller/CompanyController.php +++ b/app/adminapi/controller/CompanyController.php @@ -147,13 +147,12 @@ class CompanyController extends BaseAdminController $res = app(JunziqianController::class)->SigningLink($data); if ($res->success == true) { Db::name('contract')->where('id', $company['contract_id'])->update(['url' => $res->data]); - $url = explode('https://h5.sandbox.junziqian.com/', $res->data); //发送短信 $sms = [ 'mobile' => $company['master_phone'], 'name' => $company['company_name'], 'type' => '《' . $find['contract_type_two_name'] . '》', - 'code' => $url[1], + 'code' => 'api/Hetong/'.$find['id'], 'scene' => 'WQ' ]; $result = SmsLogic::contractUrl($sms); @@ -188,17 +187,19 @@ class CompanyController extends BaseAdminController }) ->find(); if ($find) { - $data = array( - "applyNo" => $find['contract_no'], //TODO * - "fullName" => $company['company_name'], //TODO * - "identityCard" => $company['organization_code'], //TODO * - "identityType" => 12, //TODO * - ); - $res = app(JunziqianController::class)->sms($data); - if($res->success == true){ + //发送短信 + $sms = [ + 'mobile' => $company['master_phone'], + 'name' => $company['company_name'], + 'type' => '《' . $find['contract_type_two_name'] . '》', + 'code' => 'api/Hetong/'.$find['id'], + 'scene' => 'WQ' + ]; + $result = SmsLogic::contractUrl($sms); + if (true === $result) { return $this->success('发送成功'); - }else{ - return $this->fail($res->msg); + } else { + return $this->fail(SmsLogic::getError()); } } } diff --git a/app/api/controller/Hetong.php b/app/api/controller/Hetong.php new file mode 100644 index 000000000..36c136c2b --- /dev/null +++ b/app/api/controller/Hetong.php @@ -0,0 +1,35 @@ +where('id',$id)->value('url'); + if($url){ + return redirect($url); + } + } + return '
合同不存在