40 lines
1.1 KiB
PHP
40 lines
1.1 KiB
PHP
<?php
|
|
|
|
namespace app\api\controller;
|
|
|
|
use app\common\logic\vehicle\VehicleLogic;
|
|
use think\response\Json;
|
|
|
|
class VehicleController extends BaseApiController
|
|
{
|
|
public function setContractByTownCompany():Json
|
|
{
|
|
//获取参数
|
|
$params = $this->request->post(['num']);
|
|
//验证参数
|
|
if(empty($params['num'])){
|
|
return $this->fail('缺少必要参数');
|
|
}
|
|
if(empty($this->userInfo['company_id'])){
|
|
return $this->fail('签约公司不存在');
|
|
}
|
|
$params['party_b'] = $this->userInfo['company_id'];
|
|
$result = VehicleLogic::initiate_contract($params);
|
|
//返回数据
|
|
if($result && $result['code'] == 1){
|
|
return $this->success($result['msg']);
|
|
}else{
|
|
return $this->fail($result['msg']);
|
|
}
|
|
}
|
|
|
|
// public function vehicleList() {
|
|
// //获取参数
|
|
// $params = $this->request->get(['is_rent','license']);
|
|
// if(empty($params['is_rent'])){
|
|
// return $this->fail('缺少必要参数');
|
|
// }
|
|
// }
|
|
|
|
|
|
} |