request->get(['page_no','page_size']); //获取数据 $data = VehicleLogic::lists($params); //返回数据 return $this->success('请求成功',$data); } /* * 三轮车批量出租 */ public function multipleRent() { //获取参数 $params = $this->request->post(['company_id','car_ids','start_time','end_time']); //验证参数 if(empty($params['company_id']) || empty($params['car_ids']) || empty($params['start_time']) || empty($params['end_time'])) { return $this->fail('缺少必要参数'); } if(!checkDateIsValid($params['start_time']) || !checkDateIsValid($params['end_time'])){ return $this->fail('时间格式错误'); } //写入数据 $result = VehicleLogic::oneLevelRent($params); //返回结果 if($result['code'] == 1){ return $this->success($result['msg']); }else{ return $this->fail($result['msg']); } } /* * 三轮车单辆出租 */ public function singleRent() { //获取参数 $params = $this->request->post(['lessor_company_id','tenant_company_id','car_id','start_time','end_time']); //验证参数 if(empty($params['lessor_company_id']) || empty($params['tenant_company_id']) || empty($params['car_id']) || empty($params['start_time']) || empty($params['end_time'])){ return $this->fail('缺少必要参数'); } if(!checkDateIsValid($params['start_time']) || !checkDateIsValid($params['end_time'])){ return $this->fail('时间格式错误'); } //写入数据 $result = VehicleLogic::twoLevelRent($params); //返回结果 if($result['code'] == 1){ return $this->success($result['msg']); }else{ return $this->fail($result['msg']); } } }