Parcourir la source

中通接口没有返回信息系统异常

ANG YU il y a 5 ans
Parent
commit
136fb0d27a
1 fichiers modifiés avec 4 ajouts et 3 suppressions
  1. 4 3
      app/Jobs/LogisticZopSync.php

+ 4 - 3
app/Jobs/LogisticZopSync.php

@@ -41,6 +41,7 @@ class LogisticZopSync implements ShouldQueue
         ini_set('max_execution_time', 10);
         $zopResult = [];
         $response = $this->sentRequestToZT();
+        if(is_null($response)) return;
         if ($response->status) {
             $zopResult[] = [
                 'routes' => $response->result,
@@ -123,7 +124,7 @@ class LogisticZopSync implements ShouldQueue
         $delivered_duration = now()->diffInHours(Carbon::parse($orderPackage['sent_at']));
         $last_routed_duration = now()->diffInHours(Carbon::parse($lastRouteDate));
         $VALID_HOURS = 4;
-        $SHORT_RESPONSE_HOURS =  (function ($province) {
+        $SHORT_RESPONSE_HOURS = (function ($province) {
             switch ($province) {
                 case '浙江省':
                 case '江苏省':
@@ -247,8 +248,8 @@ class LogisticZopSync implements ShouldQueue
             default:
                 break;
         }
-        if($conclusion
-            ==($conclusion | $IS_ROUTED | $IS_IN_VALID_TIME | $IS_SENDING | $IS_SENDING_NO_RESPONSE)){
+        if ($conclusion
+            == ($conclusion | $IS_ROUTED | $IS_IN_VALID_TIME | $IS_SENDING | $IS_SENDING_NO_RESPONSE)) {
             $data['exception_type'] = '派件异常';
         }
         switch ($conclusion) {