cqp 2 bulan lalu
induk
melakukan
5540568c28
2 mengubah file dengan 4 tambahan dan 4 penghapusan
  1. 1 1
      app/Jobs/ProcessDataJob.php
  2. 3 3
      app/Service/U8ServerService.php

+ 1 - 1
app/Jobs/ProcessDataJob.php

@@ -23,7 +23,7 @@ class ProcessDataJob implements ShouldQueue
 
     protected $data;
 
-    public $tries = 0;
+    public $tries = 1;
     public $timeout = 60;
 
     //1 采购  2 销售(合同) 3 总社库存

+ 3 - 3
app/Service/U8ServerService.php

@@ -367,9 +367,9 @@ class U8ServerService extends Service
                 "bodys"=>$bodys
             ];
 
-            file_put_contents('record_purchase.txt',"请求参数:" . json_encode($post) . PHP_EOL,8);
+            file_put_contents('record_purchase.txt',date("Y-m-d H:i:s") . "请求参数:" . json_encode($post) . PHP_EOL,8);
             $return = $this->post_u8_helper($this->u8_api,json_encode($post), ['Content-Type:application/json']);
-            file_put_contents('record_purchase.txt',"返回结果:" . json_encode($return). PHP_EOL,8);
+            file_put_contents('record_purchase.txt',date("Y-m-d H:i:s") ."返回结果:" . json_encode($return). PHP_EOL,8);
 
             //剔除数据
             $id = array_diff($id, [$value['id']]);
@@ -663,7 +663,7 @@ class U8ServerService extends Service
         return $return;
     }
 
-    public function post_u8_helper($url, $data, $header = [], $timeout = 40){
+    public function post_u8_helper($url, $data, $header = [], $timeout = 50){
         $ch = curl_init();
         curl_setopt($ch, CURLOPT_URL, $url);
         curl_setopt($ch,  CURLOPT_RETURNTRANSFER, true);