Browse Source

Merge remote-tracking branch 'origin/fyy' into fyy

cqpCow 2 years ago
parent
commit
7b66c56eb4
1 changed files with 19 additions and 0 deletions
  1. 19 0
      app/Service/Box/BoxService.php

+ 19 - 0
app/Service/Box/BoxService.php

@@ -206,6 +206,23 @@ class BoxService extends Service
     {
         list($status, $data) = self::$box_hook->boxDetail($data);
         if (!$status) return [false, $data];
+        $sale_orders_product_ids = [];
+        foreach ($data as $v){
+            $sale_orders_product_ids[] = $v['top_id'];
+        }
+        $list = SaleOrdersProduct::wherein('id',$sale_orders_product_ids)->get()->toArray();
+        $key_list = [];
+        foreach ($list as $v){
+            $key_list[$v['id']] = $v;
+        }
+
+        foreach ($data as &$v){
+            $detail =  $key_list[$v['top_id']];
+            $v['process'] = $detail['technology_material'];
+            $v['process_title'] = $detail['technology_name'];
+            $v['material_name'] = $detail['wood_name'];
+            $v['process_mark'] = $detail['process_mark'];
+        }
         return [true, $data];
     }
 
@@ -334,6 +351,8 @@ class BoxService extends Service
         foreach ($data as &$v){
             $v['wood_name'] = $key_list[$v['top_id']]['wood_name'];
             $v['technology_name'] = $key_list[$v['top_id']]['technology_name'];
+            $v['process_mark'] = $key_list[$v['top_id']]['process_mark'];
+            $v['technology_material'] = $key_list[$v['top_id']]['technology_material'];
         }
         if (!$status) return [false, $data];
         return [true, $data];