luck 4 vuotta sitten
vanhempi
sitoutus
740602f24e
1 muutettua tiedostoa jossa 11 lisäystä ja 3 poistoa
  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'=>'请选择一个站点'));
+    }