三轮车上传合同逻辑修改
This commit is contained in:
parent
0ca903047e
commit
40bd9ca6d0
@ -30,38 +30,30 @@ class VehicleContractController extends BaseAdminController
|
||||
return $this->fail('参数cars无效');
|
||||
}
|
||||
}
|
||||
if($vehicle_contract['type'] == 1 || $vehicle_contract['type'] == 2 || $vehicle_contract['type'] == 3){
|
||||
$params['cars'] = $vehicle_contract['cars_info'];
|
||||
}
|
||||
if($vehicle_contract['status'] != 0){
|
||||
return $this->fail('合同状态错误');
|
||||
}
|
||||
//更新本地
|
||||
try {
|
||||
$data = [
|
||||
'id' => $vehicle_contract['contract_logistic_id'],
|
||||
'file' => $params['file'],
|
||||
'status' => 1,
|
||||
];
|
||||
//判断合同类型
|
||||
if($vehicle_contract['type'] == 0){
|
||||
$data['cars_info'] = $params['cars'];
|
||||
}
|
||||
if(!empty($vehicle_contract['contract_logistic_id'])){
|
||||
//更新物流系统
|
||||
curl_post(env('project.logistic_domain').'/api/contractUpdate',[],[
|
||||
'id' => $vehicle_contract['contract_logistic_id'],
|
||||
'file' => $params['file'],
|
||||
'status' => 1,
|
||||
'cars_info' => $params['cars']
|
||||
]);
|
||||
VehicleContract::where('id', $params['id'])->update(['file' => $params['file'],'cars_info' => $params['cars'],'status'=>1]);
|
||||
}else{
|
||||
VehicleContract::where('id', $params['id'])->update(['file' => $params['file'],'status'=>1]);
|
||||
curl_post(env('project.logistic_domain').'/api/contractUpdate',[],$data);
|
||||
}
|
||||
unset($data['id']);
|
||||
VehicleContract::where('id', $params['id'])->update($data);
|
||||
|
||||
}catch (\Exception $e){
|
||||
return $this->fail($e->getMessage());
|
||||
}
|
||||
//发送短信
|
||||
$sms = [
|
||||
'mobile' => $vehicle_contract['company_a_phone'],
|
||||
'name' => $vehicle_contract['company_user'],
|
||||
'scene' => 'WQTZ'
|
||||
];
|
||||
$this->rentNoticeSms($sms);
|
||||
return $this->success('上传成功', [], 1, 1);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user