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 '
合同不存在