2023-08-25 13:58:06 +08:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace app\api\controller;
|
|
|
|
|
|
|
|
use app\common\logic\vehicle\VehicleLogic;
|
|
|
|
use think\response\Json;
|
|
|
|
|
|
|
|
class VehicleController extends BaseApiController
|
|
|
|
{
|
|
|
|
public function setContractByTownCompany():Json
|
|
|
|
{
|
|
|
|
//获取参数
|
2023-08-29 17:23:36 +08:00
|
|
|
$params = $this->request->post(['num']);
|
2023-08-25 13:58:06 +08:00
|
|
|
//验证参数
|
2023-08-29 17:23:36 +08:00
|
|
|
if(empty($params['num'])){
|
2023-08-25 13:58:06 +08:00
|
|
|
return $this->fail('缺少必要参数');
|
|
|
|
}
|
|
|
|
if(empty($this->userInfo['company_id'])){
|
|
|
|
return $this->fail('签约公司不存在');
|
|
|
|
}
|
|
|
|
$params['party_b'] = $this->userInfo['company_id'];
|
|
|
|
$result = VehicleLogic::initiate_contract($params);
|
|
|
|
//返回数据
|
2023-08-29 17:23:36 +08:00
|
|
|
if($result && $result['code'] == 1){
|
2023-08-26 14:04:16 +08:00
|
|
|
return $this->success($result['msg']);
|
|
|
|
}else{
|
|
|
|
return $this->fail($result['msg']);
|
|
|
|
}
|
|
|
|
}
|
2023-08-26 16:15:14 +08:00
|
|
|
|
2023-08-26 17:22:43 +08:00
|
|
|
|
2023-08-25 13:58:06 +08:00
|
|
|
}
|