cqp 1 month ago
parent
commit
c008920fb0
2 changed files with 8 additions and 2 deletions
  1. 6 2
      app/Service/ApplyOrderService.php
  2. 2 0
      app/Service/ReportFormsService.php

+ 6 - 2
app/Service/ApplyOrderService.php

@@ -522,9 +522,11 @@ class ApplyOrderService extends Service
                 $product_unit = $t['product_unit'] ?? "";
             }
 
+            $quantity = $t['quantity'] ?? 0;
+            if($detail['type'] == ApplyOrder::type_four) $quantity = 1;
             $return[] = [
                 'id' => $t['data_id'] ?? 0,
-                'quantity' => $t['quantity'] ?? 0,
+                'quantity' => $quantity,
                 'product_no' => $t['product_no'] ?? "",
                 'product_title' => $t['product_title'] ?? "",
                 'product_size' => $t['product_size'] ?? "",
@@ -1468,10 +1470,12 @@ class ApplyOrderService extends Service
                 $order_no = $tmp['order_no'] ?? "";
             }
 
+            $quantity = $t['quantity'] ?? 0;
             if($t['type'] == ApplyOrder::type_two || $t['type'] == ApplyOrder::type_three){
                 $product_unit = "吨";
             }elseif($t['type'] == ApplyOrder::type_four){
                 $product_unit = "只";
+                $quantity = 1;
             }else{
                 $product_unit = $t['product_unit'] ?? "";
             }
@@ -1487,7 +1491,7 @@ class ApplyOrderService extends Service
                 'storehouse_title' => $tmp['storehouse_title'],
                 'id' => $t['data_id'] ?? 0,
 //                'main_id' => $t['id'],
-                'quantity' => $t['quantity'] ?? 0,
+                'quantity' => $quantity,
                 'product_no' => $t['product_no'] ?? "",
                 'product_title' => $t['product_title'] ?? "",
                 'product_size' => $t['product_size'] ?? "",

+ 2 - 0
app/Service/ReportFormsService.php

@@ -978,6 +978,8 @@ class ReportFormsService extends Service
 
         $return = [];
         foreach ($process_time as $key => $value){
+            ksort($value);
+
             $tmp['title'] = $key;
             $tmp['list'] = [];
             foreach ($value as $k => $v){