diff --git a/app/api/controller/IndexController.php b/app/api/controller/IndexController.php index c8d171972..af61aaa6c 100755 --- a/app/api/controller/IndexController.php +++ b/app/api/controller/IndexController.php @@ -30,10 +30,9 @@ use think\response\Json; */ class IndexController extends BaseApiController { - public array $notNeedLogin = ['index', 'config', 'policy', 'decorate', 'notifyUrl','notifyProperty','notifyAuthentication','notifyVehicleContractUpdate','systemCarRent','selfCarRent','cancelContract']; + public array $notNeedLogin = ['index', 'config', 'policy', 'decorate', 'notifyUrl','notifyProperty','notifyAuthentication','notifyVehicleContractUpdate','systemCarRent','selfCarRent','cancelRent']; private $domain = 'https://logistics.lihaink.cn'; -// private $domain = 'http://www.lst.local'; /** * @notes 首页数据 @@ -156,10 +155,18 @@ class IndexController extends BaseApiController 'rent_time' => time(), 'rent_company_id' => $contract['company_b_id'], ]); + $party_b = Company::where('id',$contract['company_b_id'])->find(); //通知物流系统跟新 - curl_post($this->domain.'/api/cancelRent',[],[ + curl_post($this->domain.'/api/updateVehicleRent',[],[ 'car_id' => $vehicle['id'], - 'status' => 1 + 'use_user_id' => $party_b['user_id'], + 'use_user_name' => $party_b['master_name'], + 'use_user_phone' => $party_b['master_phone'] + ]); + CompanyProperty::create([ + 'company_id' => $contract['company_b_id'], + 'object_id' => $vehicle['id'], + 'type' => 1 ]); return json(['success' => true, 'msg' => '成功']); }else{ @@ -239,7 +246,7 @@ class IndexController extends BaseApiController } //解除合同回调 - public function cancelContract() { + public function cancelRent() { //获取参数 $id = $this->request->get('id'); if(empty($id)){ @@ -270,6 +277,11 @@ class IndexController extends BaseApiController VehicleRent::where('car_id',$vehicle['id'])->update([ 'status' => 3, ]); + //通知物流系统跟新 + curl_post($this->domain.'/api/cancelRent',[],[ + 'car_id' => $vehicle['id'], + 'status' => 1 + ]); return json(['success' => true, 'msg' => '成功']); }else{ return json(['success' => true, 'msg' => '成功']);