Browse Source

云途的15s判断

lvhao 3 tháng trước cách đây
mục cha
commit
7ec8722344
1 tập tin đã thay đổi với 7 bổ sung1 xóa
  1. 7 1
      core/CoreApp/models/Model_yuntu.php

+ 7 - 1
core/CoreApp/models/Model_yuntu.php

@@ -23,6 +23,7 @@ class Model_yuntu extends Lin_Model
     // ];
     function __construct(){
 		parent::__construct();
+        $this->load->_model("Model_logic_ding",'logic_ding');
     }
 
     public function get_data($data){
@@ -107,9 +108,10 @@ class Model_yuntu extends Lin_Model
             ];
         }
      
-       
+        $start_time = time();
        
         $res = $this->sendNewPost($url,$params,$token);
+       
         // echo "<pre>";
         // var_dump($params);
         // var_dump($res);
@@ -122,6 +124,10 @@ class Model_yuntu extends Lin_Model
         }else{
             usleep(30);
             $r = $this->get_label($res['result']['waybill_number']);
+            $end_time = time();
+            if( $end_time - $start_time  > 15){
+                $this->logic_ding->addJobs('outtime_order',['number'=>$data['number']]);
+            }
             //var_dump($res);
             if($r['x'] != 1){
                 return [