wzh 5 tahun lalu
induk
melakukan
738d9a53fd
1 mengubah file dengan 49 tambahan dan 1 penghapusan
  1. 49 1
      api/application/controllers/Common.php

+ 49 - 1
api/application/controllers/Common.php

@@ -27,7 +27,7 @@ class Common extends CI_Controller {
         if(empty($client_key)) exit(json_result('0003', $this->response['0003']));
         if(empty($username) || empty($password)) exit(json_result('0100', $this->response['0100']));
         $password = md5($password);
-        
+
         if(empty($os) && empty($code)) exit(json_result('0105', $this->response['0105']));
         if (empty($os) && !isset($_SESSION['login_code'])) exit(json_result('0106',$this->response['0106']));
         if (empty($os) && $_SESSION['login_code'] != $code) exit(json_result('0107',$this->response['0107']));
@@ -192,6 +192,54 @@ class Common extends CI_Controller {
 
         exit(json_result('0000',$this->response['0000'],array('path'=>base_url($url))));
     }
+    public function workmode() {
+        $version = $this->session->userdata('version');
+        if (empty($version)) {
+            $data = (object)array(
+                0 => '纯光控、光控开负载、光控关负载',
+                1 => '光控开负载,延时1小时后关闭负载',
+                2 => '光控开负载,延时2小时后关闭负载',
+                3 => '光控开负载,延时3小时后关闭负载',
+                4 => '光控开负载,延时4小时后关闭负载',
+                5 => '光控开负载,延时5小时后关闭负载',
+                6 => '光控开负载,延时6小时后关闭负载',
+                7 => '光控开负载,延时7小时后关闭负载',
+                8 => '光控开负载,延时8小时后关闭负载',
+                9 => '光控开负载,延时9小时后关闭负载',
+                10 => '光控开负载,延时10小时后关闭负载',
+                11 => '光控开负载,延时11小时后关闭负载',
+                12 => '光控开负载,延时12小时后关闭负载',
+                13 => '光控开负载,延时13小时后关闭负载',
+                14 => '光控开负载,延时14小时后关闭负载',
+                15 => '手动模式',
+                16 => '调试模式',
+                17 => '常开模式'
+            );
+        }else{
+            $data = (object)array(
+                0 => 'Pure light control, light control open load, light control load',
+                1 => 'Light control open load, delay 1 hours to close the load',
+                2 => 'Light control open load, delay 2 hours to close the load',
+                3 => 'Light control open load, delay 3 hours to close the load',
+                4 => 'Light control open load, delay 4 hours to close the load',
+                5 => 'Light control open load, delay 5 hours to close the load',
+                6 => 'Light control open load, delay 6 hours to close the load',
+                7 => 'Light control open load, delay 7 hours to close the load',
+                8 => 'Light control open load, delay 8 hours to close the load',
+                9 => 'Light control open load, delay 9 hours to close the load',
+                10 => 'Light control open load, delay 10 hours to close the load',
+                11 => 'Light control open load, delay 11 hours to close the load',
+                12 => 'Light control open load, delay 12 hours to close the load',
+                13 => 'Light control open load, delay 13 hours to close the load',
+                14 => 'Light control open load, delay 14 hours to close the load',
+                15 => 'Manual mode',
+                16 => 'Debug mode',
+                17 => 'Open mode'
+            );
+        }
+        
+        exit(json_result('0000', $this->response['0000'], $data));
+    }
 
 
     // 批量导入