wzh vor 5 Jahren
Ursprung
Commit
8cb50cd150
2 geänderte Dateien mit 48 neuen und 1 gelöschten Zeilen
  1. 1 1
      api/.htaccess
  2. 47 0
      api/application/controllers/Home.php

+ 1 - 1
api/.htaccess

@@ -1,4 +1,4 @@
-RewriteEngine on
+RewriteEngine off
 
 RewriteCond %{REQUEST_FILENAME} !-f
 RewriteCond %{REQUEST_FILENAME} !-d

+ 47 - 0
api/application/controllers/Home.php

@@ -0,0 +1,47 @@
+<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
+
+include_once(FCPATH . 'application/controllers/Base_Controller.php');
+class Home extends Base_Controller {
+
+    public function __construct() {
+        parent::__construct();
+    }
+
+    // 设备统计信息
+    public function data(){
+    	$data = array(
+    		'day_new_count' => 0,
+    		'day_faulty_count' => 0,
+    		'total_light_count' => 0,
+    		'light_up_count' => 0,
+    		'online_count' => 0,
+    		'faulty_count' => 0,
+    	);
+
+    	exit(json_result('0000',$this->response['0000'],$data));
+    }
+
+    // 发用电量统计信息
+    public function sta_info(){
+    	$data = array(
+    		'electricity' => 0,
+    		'CO2_reduction' => 0,
+    		'SO2_reduction' => 0,
+    		'TCE_reduction' => 0
+    	);
+
+    	exit(json_result('0000',$this->response['0000'],$data));
+    }
+
+    // 设备统计列表
+    public function dev_list(){
+
+    	exit(json_result('0000',$this->response['0000'],array('list'=>array())));
+    }
+
+    // 故障信息列表
+    public function alarm_list(){
+
+    	exit(json_result('0000',$this->response['0000'],array()));
+    }
+}