cqpCow 10 ماه پیش
والد
کامیت
cc15562cc4
1فایلهای تغییر یافته به همراه4 افزوده شده و 44 حذف شده
  1. 4 44
      app/Service/JRFIDServerService.php

+ 4 - 44
app/Service/JRFIDServerService.php

@@ -121,52 +121,12 @@ class JRFIDServerService extends Service
         if(! empty($result['status']) && $result['status'] == 'error') return [false, $result['message']];
         if(! empty($result['type']) && $result['type'] == 'errorVm') return [false, $result['message']];
 
-//        $return = $this->clearPrintData($data, $result);
-
-        return [true, $result];
-    }
-
-    public function clearPrintData($data,$result){
-        //分页参数
-        $size = $data['size'] ?? 10;
-        $number = $data['number'] ?? 1;
-
-        if(empty($result['furn_pro_flow_dt_a'])) return [];
-        $furn_pro_flow_dt_a = $result['furn_pro_flow_dt_a'];
-
-        //排序
-        usort($furn_pro_flow_dt_a, function($a, $b) {
-            return $b['id'] - $a['id'];
-        });
-
-        //总数
-        $total = count($furn_pro_flow_dt_a);
-        // 计算总页数
-        $totalPages = ceil($total / $size);
-        // 确保请求的页码在有效范围内
-        $page = $number;
-        // 计算当前页的起始索引
-        $offset = ($page - 1) * $size;
-        //切片数据以获取当前页的数据
-        $currentPageData = array_slice($furn_pro_flow_dt_a, $offset, $size);
-
-        if(empty($currentPageData)) return [];
-        unset($result['furn_pro_flow_dt_a']);
-
-        foreach ($furn_pro_flow_dt_a as $key => $value){
-            foreach ($result['furn_pro_flow_dt_assem'] as $v1){
-                if($v1['main_table_id'] == $value['id']){
-                    foreach ($result['furn_pro_flow_dt_comp'] as $v2){
-                        if($v2['main_table_id'] == $v1['id']) {dd(22);
-                            $v1['furn_pro_flow_dt_comp'][] = $v2;
-                        }
-                    }
-                    $furn_pro_flow_dt_a[$key]['furn_pro_flow_dt_assem'][] = $v1;
-                }
-            }
+        if(! isset($result['furn_pro_flow_dt_a'])) {
+            $error = $result[0]['message'] ?? "操作失败,请刷新页面";
+            return [false, $error];
         }
 
-        dd($furn_pro_flow_dt_a, 1);
+        return [true, $result];
     }
 
     public function getTeam($data,$param){