MS-CGGBQLOTBCKH\Administrator 5 år sedan
förälder
incheckning
9656fd17a0
1 ändrade filer med 7 tillägg och 1 borttagningar
  1. 7 1
      api/application/controllers/Common.php

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

@@ -283,14 +283,20 @@ class Common extends CI_Controller {
     // 通过设备地址获取制造商id
     public function get_manu_by_address(){
         $address = $this->input->post('address',true);
+        $name = '';
         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();
+            $res = $this->db->query('select id,name,no from company where companyId like "'.$id.'%" order by id desc')->row_array();
             if (empty($res) || empty($res['id'])) {
                 $id = 0;
             }else{
                 $id = $res['id'];
+                if (!empty($res['no'])) {
+                    $name = $res['no'];
+                }else{
+                    $name = $res['name'];
+                }
             }
         }
         exit(json_result('0000',$this->response['0000'],array('id'=>$id)));