cqpCow 9 달 전
부모
커밋
53550cbdf0
2개의 변경된 파일7개의 추가작업 그리고 0개의 파일을 삭제
  1. 6 0
      app/Service/ProductService.php
  2. 1 0
      app/Service/SalesOrderService.php

+ 6 - 0
app/Service/ProductService.php

@@ -863,6 +863,12 @@ class ProductService extends Service
     public function getProductDetail($product_id = []){
         if(empty($product_id)) return [];
         $pro = Product::whereIn('id', $product_id)->get()->toArray();
+        $category = ProductCategory::whereIn('id',array_unique(array_column($pro,'product_category_id')))
+            ->pluck('is_edit_unit_price','id')
+            ->toArray();
+        foreach ($pro as $key => $value){
+            $pro[$key]['is_edit_unit_price'] = $category[$value['product_category_id']] ?? 0;
+        }
         return array_column($pro,null,'id');
     }
 

+ 1 - 0
app/Service/SalesOrderService.php

@@ -994,6 +994,7 @@ class SalesOrderService extends Service
             foreach ($sales_p_info as $value){
                 $tmp = $map[$value['product_id']] ?? [];
                 $value['title'] = $tmp['title'] ?? "";
+                $value['is_edit_unit_price'] = $tmp['is_edit_unit_price'] ?? 0;
                 $value['code'] = $tmp['code'] ?? "";
                 $value['size'] = $tmp['size'] ?? "";
                 $value['unit'] = $tmp['unit'] ?? "";