diff --git a/app/adminapi/controller/contract/ContractController.php b/app/adminapi/controller/contract/ContractController.php index ff1e8d9c..71de594e 100644 --- a/app/adminapi/controller/contract/ContractController.php +++ b/app/adminapi/controller/contract/ContractController.php @@ -21,8 +21,8 @@ class ContractController extends BaseAdminController if(!$contract || $contract->isEmpty()){ return $this->fail('数据不存在'); } - if($contract['status'] == 3 || $contract['status'] == 4){ - return $this->fail('合同已发送'); + if($contract['status'] != 1){ + return $this->fail('合同状态错误'); } //获取平台公司 $platform = Platform::find(1); @@ -39,15 +39,15 @@ class ContractController extends BaseAdminController $contract->save([ 'id' => $contract['id'], 'contract_no' => $signRes->data, - 'status' => 3 + 'status' => 2 ]); $this->sendSms($params['id']); $newData = Contract::where('id', $params['id'])->find(); curl_post('https://worker-task.lihaink.cn/api/index/notifyVehicleContractUpdate',[],[ - 'id' => $contract['id'], + 'contract_logistic_id' => $contract['id'], 'contract_no' => $signRes->data, 'url' => $newData['url'], - 'status' => 3 + 'status' => 2 ]); return $this->success('合同发送成功'); } else { diff --git a/app/api/controller/ContractController.php b/app/api/controller/ContractController.php index 9483ea7f..88a74cfc 100644 --- a/app/api/controller/ContractController.php +++ b/app/api/controller/ContractController.php @@ -47,7 +47,7 @@ class ContractController extends BaseApiController 'company_b_email' => $params['company_email'], 'num' => $params['num'], 'cars_info' => $cars->toJson(), - 'status' => 1, + 'status' => 0, 'create_time' => time(), 'update_time' => time(), ]; @@ -57,7 +57,8 @@ class ContractController extends BaseApiController $carStatus = Vehicle::where('id','in',array_column($cars->toArray(),'id'))->update(['status'=>2,'update_time'=>time()]); //返回 if($result->id && $carStatus) { - $data['id'] = $result->id; + $data['contract_logistic_id'] = $result->id; + $data['type'] = 0; return $this->success('合同发起成功,等待审核',$data); }else{ return $this->fail('请求失败'); diff --git a/app/api/controller/IndexController.php b/app/api/controller/IndexController.php index 3179feab..8396b3b3 100755 --- a/app/api/controller/IndexController.php +++ b/app/api/controller/IndexController.php @@ -107,16 +107,16 @@ class IndexController extends BaseApiController if ($contract['signing_timer'] == 0) { Contract::where('id',$params['id'])->update(['signing_timer'=>1]); curl_post('https://worker-task.lihaink.cn/api/index/notifyVehicleContractUpdate',[],[ - 'id' => $contract['id'], + 'contract_logistic_id' => $contract['id'], 'signing_timer' => 1, ]); }else if($contract['signing_timer'] == 1) { - Contract::where('id',$params['id'])->update(['signing_timer'=>2,'status'=>4]); + Contract::where('id',$params['id'])->update(['signing_timer'=>2,'status'=>3]); Vehicle::where('id','in',$carIds)->update(['status'=>3]); curl_post('https://worker-task.lihaink.cn/api/index/notifyVehicleContractUpdate',[],[ - 'id' => $contract['id'], + 'contract_logistic_id' => $contract['id'], 'signing_timer' => 2, - 'status' => 4 + 'status' => 3 ]); curl_post('https://worker-task.lihaink.cn/v1/notify_property',[],[ 'company_id' => $contract['company_b_id'], diff --git a/app/common/model/vehicle/VehicleUser.php b/app/common/model/vehicle/VehicleUser.php new file mode 100644 index 00000000..7d5adda8 --- /dev/null +++ b/app/common/model/vehicle/VehicleUser.php @@ -0,0 +1,10 @@ +