From 812c27f721b8f60792f3e1d3f3966d79f3357fec Mon Sep 17 00:00:00 2001 From: unknown <736250432@qq.com> Date: Sat, 9 Sep 2023 14:58:56 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=B8=89=E8=BD=AE=E8=BD=A6?= =?UTF-8?q?=E5=8F=91=E9=80=81=E5=90=88=E5=90=8C=E5=9B=9E=E8=B0=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/api/controller/IndexController.php | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/app/api/controller/IndexController.php b/app/api/controller/IndexController.php index 6d1ce74e0..83dd2e397 100755 --- a/app/api/controller/IndexController.php +++ b/app/api/controller/IndexController.php @@ -32,7 +32,7 @@ use think\response\Json; */ class IndexController extends BaseApiController { - public array $notNeedLogin = ['index', 'config', 'policy', 'decorate', 'notifyUrl', 'notifyProperty', 'notifyAuthentication', 'notifyVehicleContractUpdate', 'systemCarRent', 'selfCarRent', 'cancelRent']; + public array $notNeedLogin = ['index', 'config', 'policy', 'decorate', 'notifyUrl', 'notifyProperty', 'notifyAuthentication', 'notifyVehicleContractUpdate','townCarRent','systemCarRent', 'selfCarRent', 'cancelRent']; /** * @notes 首页数据 @@ -144,6 +144,7 @@ class IndexController extends BaseApiController if(!$updateLocalRes || $updateSverRes['code']==0){ return json(['success' => false, 'msg' => '更新失败']); } + return json(['success' => true, 'msg' => '成功']); }else if($contract['signing_timer'] == 1){ //获取签约后的合同 $signContractFile = app(JunziqianController::class)->downloadVehicleContractFile($contract['contract_no']); @@ -159,8 +160,24 @@ class IndexController extends BaseApiController ]); //更新本地合同状态 $updateLocalRes = VehicleContract::where('id',$contract['id'])->update(['signing_timer'=>2,'status' => 3,'contract_url'=>$signContractFile,'contract_evidence'=>$contractEvidence]); + //将车辆加入到本地租赁列表 + $cars = json_decode($contract['cars_info'], true); + $data = []; + foreach ($cars as $k => $v) { + $data[$k]['car_id'] = $v['id']; + $data[$k]['car_license'] = $v['license']; + $data[$k]['type'] = 0; + $data[$k]['status'] = 0; + $data[$k]['company_id'] = $contract['company_b_id']; + $data[$k]['rent_time'] = 0; + $data[$k]['rent_company_id'] = 0; + $data[$k]['contract_id'] = $contract['id']; + $data[$k]['create_time'] = strtotime($contract['create_time']); + } + $vehicleRent = new VehicleRent(); + $vehicleRent->saveAll($data); //更新远程 - $updateSverRes =curl_post(env('project.logistic_domain').'/api/contractUpdate',[],[ + $updateSverRes = curl_post(env('project.logistic_domain').'/api/contractUpdate',[],[ 'id' => $contract['contract_logistic_id'], 'signing_timer' => 2, 'status' => 3, @@ -169,8 +186,11 @@ class IndexController extends BaseApiController ]); if(!$updateLocalRes || $updateSverRes['code']==0){ return json(['success' => false, 'msg' => '更新失败']); + }else{ + return json(['success' => true, 'msg' => '更新成功']); } } + return json(['success' => true, 'msg' => '更新成功@']); } //系统车辆租赁回来