Jelajahi Sumber

出标机 box_out

cqpCow 11 bulan lalu
induk
melakukan
8c6c9b3b3f
2 mengubah file dengan 2 tambahan dan 3 penghapusan
  1. 1 1
      app/Jobs/LabelDealJob.php
  2. 1 2
      app/Service/LabelDealService.php

+ 1 - 1
app/Jobs/LabelDealJob.php

@@ -47,7 +47,7 @@ class LabelDealJob implements ShouldQueue
             //调用保存接口
             LabelDealService::getInstance()->boxOut($lead_bind,$lead_out,$this->header,$this->id);
         }catch (\Throwable $exception){
-            echo $exception;
+            file_put_contents('msg_result.txt',date('Y-m-d H:i:s') . "队列捕获:" . $exception->getLine() . "|" . $exception->getMessage(). "|"  . $exception->getCode(). PHP_EOL,8);
             $this->delete();
         }
     }

+ 1 - 2
app/Service/LabelDealService.php

@@ -44,8 +44,7 @@ class LabelDealService extends Service
         file_put_contents('msg_result.txt',date('Y-m-d H:i:s') . "出库:" . $return_out. PHP_EOL,8);
         $return_out = json_decode($return_out, true);
 
-        //toDo
-        BigKingCbj::where('id',$id)->update(['is_successful' => 1]);
+        if(isset($return_bind['status']) && $return_bind['status'] == 'success' && isset($return_out['status']) && $return_out['status'] == 'success') BigKingCbj::where('id',$id)->update(['is_successful' => 1]);
     }
 
     public function post_helper($url, $data, $auth)