Merge pull request '三轮车上传合同逻辑修改' (#75) from zhangwei into dev
Reviewed-on: #75
This commit is contained in:
commit
546c1ca8f4
@ -30,38 +30,30 @@ class VehicleContractController extends BaseAdminController
|
|||||||
return $this->fail('参数cars无效');
|
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){
|
if($vehicle_contract['status'] != 0){
|
||||||
return $this->fail('合同状态错误');
|
return $this->fail('合同状态错误');
|
||||||
}
|
}
|
||||||
//更新本地
|
//更新本地
|
||||||
try {
|
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'])){
|
if(!empty($vehicle_contract['contract_logistic_id'])){
|
||||||
//更新物流系统
|
//更新物流系统
|
||||||
curl_post(env('project.logistic_domain').'/api/contractUpdate',[],[
|
curl_post(env('project.logistic_domain').'/api/contractUpdate',[],$data);
|
||||||
'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]);
|
|
||||||
}
|
}
|
||||||
|
unset($data['id']);
|
||||||
|
VehicleContract::where('id', $params['id'])->update($data);
|
||||||
|
|
||||||
}catch (\Exception $e){
|
}catch (\Exception $e){
|
||||||
return $this->fail($e->getMessage());
|
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);
|
return $this->success('上传成功', [], 1, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user