浏览代码

施工单修改交车逻辑

cqp 2 月之前
父节点
当前提交
641533b0cd
共有 1 个文件被更改,包括 10 次插入1 次删除
  1. 10 1
      app/Service/DataSyncToU8Service.php

+ 10 - 1
app/Service/DataSyncToU8Service.php

@@ -216,7 +216,16 @@ class DataSyncToU8Service extends Service
 
     public function forCheck2($product_category){
         $category = json_decode($product_category,true);
-        if(in_array(ProductCategory::Special_for_roll1, $category) || in_array(ProductCategory::Special_for_roll2, $category)) return true;
+        $id = ProductCategory::where('parent_id',ProductCategory::Special_for_roll_p)
+            ->where('id','<>',ProductCategory::Special_for_roll3)
+            ->select('id')
+            ->get()->toArray();
+        $id = array_column($id,'id');
+        if(empty($id)) return false;
+        foreach ($id as $value){
+            if(in_array($value, $category)) return [true, ''];
+        }
+
         return false;
     }