MS-CGGBQLOTBCKH\Administrator 5 سال پیش
والد
کامیت
264a65db25
1فایلهای تغییر یافته به همراه2 افزوده شده و 1 حذف شده
  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{