cqpCow пре 1 година
родитељ
комит
3df1e09680
2 измењених фајлова са 6 додато и 4 уклоњено
  1. 1 1
      app/Jobs/ProcessDataJob.php
  2. 5 3
      app/Service/U8ServerService.php

+ 1 - 1
app/Jobs/ProcessDataJob.php

@@ -44,7 +44,7 @@ class ProcessDataJob implements ShouldQueue
 
             //调用同步方法
             $this->$function();
-        } catch (\Exception $e) {
+        } catch (\Throwable $e) {
             $this->delete();
         }
     }

+ 5 - 3
app/Service/U8ServerService.php

@@ -121,6 +121,7 @@ class U8ServerService extends Service
 
     //采购订单保存
     public function U8PO_PomainSave($data){
+        if(! is_array($data)) $data = [$data];
         $id = $data;
 
         //映射ip是否通畅
@@ -250,6 +251,7 @@ class U8ServerService extends Service
 
     //销售订单(合同)保存
     public function U8SaleOrderSave($data){
+        if(! is_array($data)) $data = [$data];
         $id = $data;
 
         //映射ip是否通畅
@@ -399,7 +401,7 @@ class U8ServerService extends Service
         $insert = [];
 
         U8Job::where('del_time',0)
-            ->where('data_type',U8Job::one)
+            ->where('data_type',$data_type)
             ->whereIn('data',$data)
             ->update(['del_time' => $time]);
         foreach ($data as $value){
@@ -504,8 +506,8 @@ class U8ServerService extends Service
         $product = Product::whereIn('id',array_unique(array_column($sub,'product_id')))
             ->get()->toArray();
         $product_map = array_column($product,null,'id');
-
-        $code_map = BasicType::whereIn('id',array_unique(array_merge_recursive(array_column($main,'sale_type'),array_column($main,'plat_type'))))
+        $code_id = array_filter(array_unique(array_merge_recursive(array_column($main,'sale_type'),array_column($main,'plat_type'))));
+        $code_map = BasicType::whereIn('id',$code_id)
             ->pluck('title','id')
             ->toArray();
         $customer_map = Customer::whereIn('id',array_unique(array_column($main,'customer_id')))