Pārlūkot izejas kodu

安装地点写在分社施工

cqpCow 1 gadu atpakaļ
vecāks
revīzija
b5f055e175
1 mainītis faili ar 9 papildinājumiem un 8 dzēšanām
  1. 9 8
      app/Service/U8ServerService.php

+ 9 - 8
app/Service/U8ServerService.php

@@ -508,7 +508,7 @@ class U8ServerService extends Service
         $product = Product::whereIn('id',array_unique(array_column($sub,'product_id')))
             ->get()->toArray();
         $product_map = array_column($product,null,'id');
-        $code_id = array_filter(array_unique(array_merge_recursive(array_column($main,'sale_type'),array_column($main,'plat_type'))));
+        $code_id = array_filter(array_unique(array_merge_recursive(array_column($main,'sale_type'),array_column($main,'plat_type'),array_column($main,'install_position'))));
         $code_map = BasicType::whereIn('id',$code_id)
             ->pluck('title','id')
             ->toArray();
@@ -521,16 +521,17 @@ class U8ServerService extends Service
         $emp = Employee::whereIn('id',array_unique(array_column($main,'crt_id')))
             ->pluck('number','id')
             ->toArray();
-        $see = SeeRange::where('del_time',0)
-            ->whereIn('data_id',array_column($main,'id'))
-            ->where('data_type',SeeRange::type_seven)
-            ->where('type',SeeRange::data_three)
-            ->pluck('param_id','data_id')->toArray();//指派的分社
+//        $see = SeeRange::where('del_time',0)
+//            ->whereIn('data_id',array_column($main,'id'))
+//            ->where('data_type',SeeRange::type_seven)
+//            ->where('type',SeeRange::data_three)
+//            ->pluck('param_id','data_id')->toArray();//指派的分社
 
         $sub_map = [];
         foreach ($sub as $value){
             $product_tmp = $product_map[$value['product_id']] ?? [];
             $main_tmp = $main_map[$value['sales_order_id']] ?? [];
+            $position = $code_map[$main_tmp['install_position']] ?? "";
 
 //            "itaxrate"=>$son['itaxrate'], //税率
 //            "iunitprice"=>$son['iunitprice'],//原币单价
@@ -557,8 +558,8 @@ class U8ServerService extends Service
             }
             $value['cdefine25'] = $code_map[$main_tmp['plat_type']] ?? ""; //平台类型
             $value['cdefine28'] = $main_tmp['plat_order'] ?? ""; //平台单号
-            $top_depart_id = $see[$value['sales_order_id']] ?? 0;
-            $value['cdefine29'] = $depart[$top_depart_id] ?? "";//分社施工
+//            $top_depart_id = $see[$value['sales_order_id']] ?? 0;
+            $value['cdefine29'] = $position ?? "";//安装地点
             $value['cdefine32'] = "";//直播销售 暂时没有
             $value['cdefine31'] = $customer_map[$main_tmp['customer_id']] ?? "";//客户名称
             $value['cdefine22'] = $main_tmp['customer_contact'] ?? "";//手机号码