cqp 1 hari lalu
induk
melakukan
5a97d5bee3
1 mengubah file dengan 8 tambahan dan 2 penghapusan
  1. 8 2
      app/Service/ReportFormsService.php

+ 8 - 2
app/Service/ReportFormsService.php

@@ -482,7 +482,10 @@ class ReportFormsService extends Service
         //返回统计数据
         foreach ($list as $key => $value) {
             $del_num = $detail[$value['id']] ?? 0;
-            if(floatval($del_num) <= 0.0) unset($list[$key]);
+            if(floatval($del_num) <= 0.0) {
+                unset($list[$key]);
+                continue;
+            }
             $list[$key]['production_time'] = $value['production_time'] ? date('Y-m-d',$value['production_time']) : '';
             $list[$key]['out_order_no_time'] = $value['out_order_no_time'] ? date('Y-m-d',$value['out_order_no_time']) : '';
             $list[$key]['bad_goods_num'] = $del_num;
@@ -648,7 +651,10 @@ class ReportFormsService extends Service
 
         foreach ($list as $key => $value) {
             $del_num = $detail[$value['id']] ?? 0;
-            if(floatval($del_num) <= 0.0) unset($list[$key]);
+            if(floatval($del_num) <= 0.0) {
+                unset($list[$key]);
+                continue;
+            }
             $list[$key]['bad_goods_num'] = $del_num;
             $list[$key]['production_time'] = $value['production_time'] ? date('Y-m-d',$value['production_time']) : '';
             $list[$key]['out_order_no_time'] = $value['out_order_no_time'] ? date('Y-m-d',$value['out_order_no_time']) : '';