Prechádzať zdrojové kódy

change api of gaojinginfo

git 5 rokov pred
rodič
commit
bb5345253e

+ 21 - 11
Home/Lib/Action/ApiAction.class.php

@@ -120,11 +120,23 @@ class ApiAction extends Action {
 	public  function get_baojing_info(  ){
 		//$this->token_verify();
 		$plate = I('get.plate');
-		$msg = M('jms_baojing_message')->where(array('Type'=>C('STOLEN_ALARM'),'LicensePlate'=>$plate))->select();
+		if(!$plate){
+			json_fail('未获取到车牌');
+		}
+		$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('LicensePlate'=>$plate))->limit($start, $pageSize)->order('AddTime desc')->select();
 		if(!$msg){
 			$this->api_fail(C('FAIL'),'报警信息不存在');
 		}
-		$this->api_success('成功',$msg);
+		$this->api_success('成功',$msg); 
 	}
 	
  
@@ -541,8 +553,8 @@ class ApiAction extends Action {
 	public  function get_baojing_detail(  ){
 		$this->token_verify();
 		$plate = I('get.plate');
-		$addtime = I('get.addtime');
-		$msg = M('jms_baojing_message')->where(array('Type'=>C('STOLEN_ALARM'),'LicensePlate'=>$plate,'AddTime'=>$addtime))->find();
+		$id = I('get.id');
+		$msg = M('jms_baojing_message')->where(array('ID' => $id, 'LicensePlate'=>$plate))->find();
 		if(!$msg){
 			$this->api_fail(C('FAIL'),'报警信息不存在');
 		}
@@ -821,16 +833,14 @@ class ApiAction extends Action {
 		$this->token_verify();
 		$userid = I('userid');
 		$electronicPlateUrl = S('key');
-		if(!empty($electronicPlateUrl[0]['FrontElectronicPlateUrl']) && !empty($electronicPlateUrl[0]['BackElectronicPlateUrl'])){
-		     $this->api_success('成功',$electronicPlateUrl[0]);
+		if(!empty($electronicPlateUrl['FrontElectronicPlateUrl']) && !empty($electronicPlateUrl['BackElectronicPlateUrl'] )){
+			  $this->api_success('成功',$electronicPlateUrl);
 		}
 		else{
-		$result = M('jms_vehicle')->where(array('ID'=>$userid))->field('FrontElectronicPlateUrl,BackElectronicPlateUrl')->cache('key',86400)->select();
-		$electronicPlateUrl = S('key');
-		$this->api_success('成功',$electronicPlateUrl[0]);
+			$vehicle_info = M('jms_vehicle')->where(array('ID'=>$userid))->field('FrontElectronicPlateUrl,BackElectronicPlateUrl')->find();
+		   S('key',$vehicle_info,86400);
+		   $this->api_success('成功',$vehicle_info);
 		}
-		
-		
 	}
 	
  

+ 7 - 7
Home/Lib/Action/CronAction.class.php

@@ -325,18 +325,18 @@ class CronAction extends Action {
 		
 		// fly 轨迹数据
 		$msg_data = array(
-			'StationCode' => '860588041560932',
+			'StationCode' => '30B5F10116D7',
 			'StationType' => 0,
-			"CityId" => "1018",
+			"CityId" => "10",
 			"StationName" => "测试基站2",
 			"Longitude" => "114.251604",
 			"Latitude" => "22.725217",
-			"Address" => "建设大厦",
-			"AddTime" => "2019-05-16 22:40:01",
-			"VehicleNumber" => "8000000009",
+			"Address" => "建设大厦1",
+			"AddTime" => "2019-05-21 15:00:01",
+			"VehicleNumber" => "FFFFFF000003",
 			"VehicleStatus" =>  "1",
-		   "SignalCount" => 88,
-			"OnlineTime" => "2019-05-16 22:40:01"
+		    "SignalCount" => 88,
+			"OnlineTime" => date('Y-m-d H:i:s',strtotime('-2 minutes'))
 		);
 		kafkaProducer('fly_vroute_data',$msg_data);
 	}

+ 1 - 1
czapp

@@ -1 +1 @@
-Subproject commit 588973b16c88038020992dd4b65e906047f1d535
+Subproject commit d650f1e87b9daf3c55e30d7eb27e8cab22e1b334

BIN
uploadimage/gravatar.jpg