|
@@ -118,7 +118,7 @@ class ApiAction extends Action {
|
|
|
|
|
|
|
|
|
public function get_baojing_info( ){
|
|
|
- //$this->token_verify();
|
|
|
+ $this->token_verify();
|
|
|
$plate = I('get.plate');
|
|
|
if(!$plate){
|
|
|
json_fail('未获取到车牌');
|
|
@@ -132,7 +132,8 @@ class ApiAction extends Action {
|
|
|
$page = 0;
|
|
|
}
|
|
|
$start = $pageSize * $page;
|
|
|
- $msg = M('jms_baojing_message')->where(array('LicensePlate'=>$plate))->limit($start, $pageSize)->order('AddTime desc')->select();
|
|
|
+ $where =array('LicensePlate'=>$plate, 'Type' => array('neq', C('BROADCASTING') ) );
|
|
|
+ $msg = M('jms_baojing_message')->where($where)->limit($start, $pageSize)->order('AddTime desc')->select();
|
|
|
if(!$msg){
|
|
|
$this->api_fail(C('FAIL'),'报警信息不存在');
|
|
|
}
|
|
@@ -495,7 +496,25 @@ class ApiAction extends Action {
|
|
|
public function get_gonggao_info( ){
|
|
|
$this->token_verify();
|
|
|
$plate = I('get.plate');
|
|
|
- $msg = M('jms_baojing_message')->where(array('Type'=>C('BROADCASTING'),'LicensePlate'=>$plate))->select();
|
|
|
+ if(!$plate){
|
|
|
+ json_fail('无法获取车牌');
|
|
|
+ }
|
|
|
+ $cityid = I('get.cityid');
|
|
|
+ if(!$cityid){
|
|
|
+ $cityid = C('MAP_DEFAULT_CITY_ID');
|
|
|
+ }
|
|
|
+ $pageSize = I('get.pagesize');
|
|
|
+ if(!$pageSize){
|
|
|
+ $pageSize = 10;
|
|
|
+ }
|
|
|
+ $page = I('get.page');
|
|
|
+ if(!$page){
|
|
|
+ $page = 0;
|
|
|
+ }
|
|
|
+ $start = $pageSize * $page;
|
|
|
+
|
|
|
+ $msg = M('jms_baojing_message')->where(array('Type'=>C('BROADCASTING'), 'CityId' => $cityid))->limit($start, $pageSize)->order('AddTime desc')->select();
|
|
|
+
|
|
|
if(!$msg){
|
|
|
$this->api_fail(C('FAIL'),'公告信息不存在');
|
|
|
}
|
|
@@ -832,13 +851,13 @@ class ApiAction extends Action {
|
|
|
public function get_vehicle_ElectronicPlateUrl( ){
|
|
|
$this->token_verify();
|
|
|
$userid = I('userid');
|
|
|
- $electronicPlateUrl = S('key');
|
|
|
+ $electronicPlateUrl = S('electronicPlateUrl_'.$userid);
|
|
|
if(!empty($electronicPlateUrl['FrontElectronicPlateUrl']) && !empty($electronicPlateUrl['BackElectronicPlateUrl'] )){
|
|
|
$this->api_success('成功',$electronicPlateUrl);
|
|
|
}
|
|
|
else{
|
|
|
$vehicle_info = M('jms_vehicle')->where(array('ID'=>$userid))->field('FrontElectronicPlateUrl,BackElectronicPlateUrl')->find();
|
|
|
- S('key',$vehicle_info,86400);
|
|
|
+ S('electronicPlateUrl_'.$userid,$vehicle_info,86400);
|
|
|
$this->api_success('成功',$vehicle_info);
|
|
|
}
|
|
|
}
|
|
@@ -884,5 +903,26 @@ class ApiAction extends Action {
|
|
|
return $formatime;
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+ public function get_insurance_detail( ){
|
|
|
+ $this->token_verify();
|
|
|
+ $data = I('post.');
|
|
|
+ $plate = $data['plate'];
|
|
|
+ $vehicleId = M('jms_vehicle')->where(array('LicensePlate'=>$plate))->field('ID')->find();
|
|
|
+ $insureInfo = M('jms_insure')->where(array('VehicleId'=>$vehicleId['ID']))->field('StartDate,EndDate')->find();
|
|
|
+ if($insureInfo){
|
|
|
+ $insuranceDetailInfo = M('jms_insurance_detail')->where(array('VehicleId'=>$vehicleId['ID']))->select();
|
|
|
+ $insuranceInfo = M('jms_insurance')->where(array('ID'=>$insuranceDetailInfo[0]['InsuranceId']))->field('InsuranceName')->find();
|
|
|
+ $result['insuranceDetailInfo'] = $insuranceDetailInfo;
|
|
|
+ $result['insuranceName'] = $insuranceInfo['InsuranceName'];
|
|
|
+ $result['insureInfo'] = $insureInfo;
|
|
|
+ $this->api_success('成功',$result);
|
|
|
+ }
|
|
|
+ else{
|
|
|
+ $this->api_success('无保险',null);
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
}
|