MS-CGGBQLOTBCKH\Administrator 5 anni fa
parent
commit
264a65db25
1 ha cambiato i file con 2 aggiunte e 1 eliminazioni
  1. 2 1
      api/application/controllers/Common.php

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

@@ -287,7 +287,8 @@ class Common extends CI_Controller {
         if ($address === '' || $address === null){
             $id = 0;
         }else{
-            $res = $this->db->query('select id,name,no from company where companyId like "'.$id.'%" order by id desc')->row_array();
+            $companyId = substr($address,0,2);
+            $res = $this->db->query('select id,name,no from company where companyId like "'.$companyId.'%" order by id desc')->row_array();
             if (empty($res) || empty($res['id'])) {
                 $id = 0;
             }else{