MS-CGGBQLOTBCKH\Administrator 5 éve
szülő
commit
21e6e02f65
1 módosított fájl, 16 hozzáadás és 0 törlés
  1. 16 0
      api/application/controllers/Common.php

+ 16 - 0
api/application/controllers/Common.php

@@ -280,6 +280,22 @@ class Common extends CI_Controller {
         exit(json_result('0000',$this->response['0000'],['list'=>$list]));
     }
 
+    // 通过设备地址获取制造商id
+    public function get_manu_by_address(){
+        $address = $this->input->post('address',true);
+        if ($address === '' || $address === null){
+            $id = 0;
+        }else{
+            $res = $this->db->query('select id from company where companyId like "'.$id.'%" order by id desc')->row_array();
+            if (empty($res) || empty($res['id'])) {
+                $id = 0;
+            }else{
+                $id = $res['id'];
+            }
+        }
+        exit(json_result('0000',$this->response['0000'],array('id'=>$id)));
+    }
+
     // 上传固件文件
     public function uploadFilewalld(){
         $body = file_get_contents('php://input');