车辆购买回调
This commit is contained in:
parent
7a8533595a
commit
389a6d1243
@ -446,14 +446,14 @@ class IndexController extends BaseApiController
|
||||
$rentCarsInfo = VehicleRent::field('id,type,contract_id')->where('car_id',$cars_ids[0])->findOrEmpty();
|
||||
if($rentCarsInfo['type'] == 0){
|
||||
//修改租赁车俩状态
|
||||
VehicleRent::where('id',$rentCarsInfo['id'])->update(['status'=>0,'rent_time'=>0,'rent_company_id'=>0]);
|
||||
VehicleRent::where('id',$rentCarsInfo['id'])->update(['status'=>0,'rent_company_id'=>0,'rent_contract_id'=>0,'rent_time'=>0]);
|
||||
}
|
||||
if($rentCarsInfo['type'] == 1){
|
||||
//修改租赁车俩状态
|
||||
VehicleRent::where('id',$rentCarsInfo['id'])->delete();
|
||||
}
|
||||
//删除原合同
|
||||
VehicleContract::where('id',$rentCarsInfo['contract_id'])->delete();
|
||||
VehicleContract::where('id',$rentCarsInfo['rent_contract_id'])->delete();
|
||||
//修改物流系统车辆租赁信息
|
||||
curl_post(env('project.logistic_domain').'/api/Vehicle/delRentUseInfo', [], [
|
||||
'car_id' => $cars_ids[0]
|
||||
|
@ -685,7 +685,6 @@ class VehicleController extends BaseApiController
|
||||
}
|
||||
//生成本地合同
|
||||
VehicleContract::create($curl_result['data']);
|
||||
return $this->success('合同发起成功,等待审核 from task');
|
||||
}
|
||||
//如果没有租赁车俩和上传自有车辆,但有购买镇街公司租赁的车辆 则发起镇街公司与平台公司的解约合同
|
||||
if($xzRentCars->isEmpty() && !$zjRentCars->isEmpty()){
|
||||
@ -726,7 +725,6 @@ class VehicleController extends BaseApiController
|
||||
]);
|
||||
//更改本地车辆状态
|
||||
VehicleRent::where('car_id','in',$car_ids)->update(['status'=>1]);
|
||||
return $this->success('合同发起成功,等待审核 from task');
|
||||
}
|
||||
//如果有租赁车俩和上传自有车辆,但没有购买镇街公司租赁的车辆 则先向镇街公司发起解约合同
|
||||
if(!$xzRentCars->isEmpty() && $zjRentCars->isEmpty()){
|
||||
@ -769,7 +767,9 @@ class VehicleController extends BaseApiController
|
||||
'contract_id' => $res->id,
|
||||
'create_time' => time()
|
||||
]);
|
||||
return $this->success('合同发起成功,等待审核 from task');
|
||||
}
|
||||
//更新物流系统
|
||||
curl_post(env('project.logistic_domain').'/api/Vehicle/updateVehicleStatusToBuy',[],['car_ids'=>implode(',',$car_ids)]);
|
||||
return $this->success('合同发起成功,等待审核 from task');
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user