修复三轮车发送合同回调

This commit is contained in:
unknown 2023-09-09 14:58:56 +08:00
parent 7a7ab841d3
commit 812c27f721

View File

@ -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' => '更新成功@']);
}
//系统车辆租赁回来