From 8b2a2e7b2341fed33a32831284694737d0bc7555 Mon Sep 17 00:00:00 2001 From: unknown <736250432@qq.com> Date: Sat, 26 Aug 2023 14:33:04 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E8=87=AA=E6=9C=89=E8=BD=A6?= =?UTF-8?q?=E8=BE=86=E7=9A=84=E9=80=BB=E8=BE=91=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/common/logic/vehicle/VehicleLogic.php | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/app/common/logic/vehicle/VehicleLogic.php b/app/common/logic/vehicle/VehicleLogic.php index add090f79..0282e5c7a 100644 --- a/app/common/logic/vehicle/VehicleLogic.php +++ b/app/common/logic/vehicle/VehicleLogic.php @@ -10,6 +10,7 @@ use think\facade\Db; class VehicleLogic extends BaseLogic { + public static string $url = 'http://logistics.lihaink.cn'; public static function initiate_contract($data):array { $party_b = Company::field('company_type')->where('id',$data['party_b'])->find(); if($data['rent_type'] == 1){ @@ -22,6 +23,11 @@ class VehicleLogic extends BaseLogic if($party_b['company_type'] != 18){ return ['code'=>0,'msg'=>'非小组服务公司不能签约']; } + //判断小组服务公司是否添加了自有车辆 + $selfCar = curl_post(self::$url.'/api/getSelfCar',[],['company_id'=>$data['party_b']]); + if($selfCar && $selfCar['data']['has_car']){ + return ['code'=>0,'msg'=>'已上传自有车辆不能签约']; + } }else{ return ['code'=>0,'msg'=>'参数错误']; } @@ -67,7 +73,7 @@ class VehicleLogic extends BaseLogic public static function carList($params):array { //请求物流系统获取车辆详情 - $result = curl_post('http://logistics.lihaink.cn/api/companyCarList',[],$params); + $result = curl_post(self::$url.'/api/companyCarList',[],$params); if($result['code'] == 1){ foreach ($result['data'] as $k=>$v){ if($v['lessee_two_flag'] == 1){ @@ -88,8 +94,7 @@ class VehicleLogic extends BaseLogic if($company['company_type'] != 18){ return ['code'=>0,'msg'=>'非小组服务公司不能添加车辆']; } - //http://logistics.lihaink.cn - $result = curl_post('http://www.lst.local/api/addVehicle',[],$params); + $result = curl_post(self::$url.'/api/addVehicle',[],$params); if($result['code'] == 1){ return ['code'=>1,'msg'=>$result['msg']]; }else{