ayHaru 4 vuotta sitten
vanhempi
commit
ba63289daa
1 muutettua tiedostoa jossa 9 lisäystä ja 2 poistoa
  1. 9 2
      application/index/controller/Index.php

+ 9 - 2
application/index/controller/Index.php

@@ -57,7 +57,7 @@ class Index
     {
     {
         $order_sn = input('param.order_sn');
         $order_sn = input('param.order_sn');
         $trunk = input('param.trunk');
         $trunk = input('param.trunk');
-        $cabinet = input('param.cabinet');
+        $cabinet = $this->codeFormat(input('param.cabinet'));
         $result = http_get($this->mAdminUrl . '/RecordStore' ,['order_sn' => $order_sn , 'trunk' => $trunk , 'cabinet' => $cabinet]);
         $result = http_get($this->mAdminUrl . '/RecordStore' ,['order_sn' => $order_sn , 'trunk' => $trunk , 'cabinet' => $cabinet]);
         if($result == false){
         if($result == false){
             Log::record('RecordStore Error:'.$result);
             Log::record('RecordStore Error:'.$result);
@@ -74,7 +74,7 @@ class Index
     //检查订单号码
     //检查订单号码
     public function RecordFetch(){
     public function RecordFetch(){
         $trunk = input('param.trunk');
         $trunk = input('param.trunk');
-        $cabinet = input('param.cabinet');
+        $cabinet = $this->codeFormat(input('param.cabinet'));
         $result = http_get($this->mAdminUrl . '/RecordFetch' ,['trunk' => $trunk , 'cabinet' => $cabinet]);
         $result = http_get($this->mAdminUrl . '/RecordFetch' ,['trunk' => $trunk , 'cabinet' => $cabinet]);
         if($result == false){
         if($result == false){
             Log::record('RecordFetch Error:'.$result);
             Log::record('RecordFetch Error:'.$result);
@@ -86,4 +86,11 @@ class Index
         }
         }
         json_success($result['data']);
         json_success($result['data']);
     }
     }
+
+    private function codeFormat($code){
+        if(is_int($code)){
+            $code = sprintf("%02d",$code);
+        }
+        return $code;
+    }
 }
 }