luck 4 years ago
parent
commit
740602f24e
1 changed files with 11 additions and 3 deletions
  1. 11 3
      application/web/controller/IndexController.php

+ 11 - 3
application/web/controller/IndexController.php

@@ -29,14 +29,22 @@ class IndexController extends MainController
 	public function index(){
 	    //站点信息
         $primarydev=Db::table('primarydev')->select();
-        //报警设备 reportdata
-        $reportdata=Db::table('reportdata')->where(array(array('ALARMENDTIME','=','')))->select();
 
 
-        $this->api_return_json(compact('reportdata','primarydev'),1);
+        $this->api_return_json(compact('primarydev'),1);
 
     }
+    //报警设备
+    public function reportdata(){
+        $PRIMARYADDR=$this->request->param('primaryaddr');
+        if($PRIMARYADDR){
+            //报警设备 reportdata
+            $reportdata=Db::table('reportdata')->where(array(array('ALARMENDTIME','=',''),array('PRIMARYADDR','=',$PRIMARYADDR)))->select();
+            $this->api_return_json(compact('reportdata'),1);
+        }
 
+        //$this->api_return_json(array('msg'=>'请选择一个站点'));
+    }