|
@@ -508,16 +508,16 @@ 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'),array_column($main,'install_position'))));
|
|
|
+ $code_id = array_filter(array_unique(array_merge_recursive(array_column($main,'sale_type'),array_column($main,'plat_type'),array_column($main,'install_position'),array_column($main,'customer_short_name'))));
|
|
|
$code_map = BasicType::whereIn('id',$code_id)
|
|
|
->pluck('title','id')
|
|
|
->toArray();
|
|
|
$customer_map = Customer::whereIn('id',array_unique(array_column($main,'customer_id')))
|
|
|
->pluck('title','id')
|
|
|
->toArray();
|
|
|
- $depart = Depart::where('parent_id',0)
|
|
|
- ->pluck('title','id')
|
|
|
- ->toArray();
|
|
|
+// $depart = Depart::where('parent_id',0)
|
|
|
+// ->pluck('title','id')
|
|
|
+// ->toArray();
|
|
|
$emp = Employee::whereIn('id',array_unique(array_column($main,'crt_id')))
|
|
|
->pluck('number','id')
|
|
|
->toArray();
|
|
@@ -571,7 +571,7 @@ class U8ServerService extends Service
|
|
|
$sub_map[$value['sales_order_id']][] = $value;
|
|
|
}
|
|
|
foreach ($main as $key => $value){
|
|
|
-// $plat_type = $code_map[$value['plat_type']] ?? "";
|
|
|
+ $customer_short_name = $code_map[$value['customer_short_name']] ?? "";
|
|
|
// if($plat_type == "营销部"){
|
|
|
// $ccusabbname = "营销部客户";
|
|
|
// }else{
|
|
@@ -579,7 +579,7 @@ class U8ServerService extends Service
|
|
|
// }
|
|
|
$main[$key]['cbustype'] = "普通销售"; //业务类型(本身就是中文)
|
|
|
$main[$key]['cstname'] = SalesOrder::$model_type_title[$value['model_type']] ?? ""; //销售类型
|
|
|
- $main[$key]['ccusabbname'] = $value['customer_short_name'];//客户简称
|
|
|
+ $main[$key]['ccusabbname'] = $customer_short_name;//客户简称
|
|
|
// $main[$key]['cdepname'] = $depart[$value['top_depart_id']] ?? "";//部门名称
|
|
|
// $main[$key]['cpersoncode'] = $emp[$value['crt_id']] ?? "";//业务员
|
|
|
$main[$key]['jobnumber'] = $emp[$value['crt_id']] ?? "";
|