ShuanghongS há 6 dias atrás
pai
commit
dafcaf2127
1 ficheiros alterados com 16 adições e 10 exclusões
  1. 16 10
      utils/common.class.php

+ 16 - 10
utils/common.class.php

@@ -4629,7 +4629,13 @@ class common {
                         / (1.0 / 1000.0)
                         / (1.0 / 1000.0)
                         / (COALESCE(NULLIF(trim(oo.piece_count), ''), '0')::numeric / (1.0 / (COALESCE(co2_r.pickup_distances, 0) +COALESCE(co2_r.routes_distances, 0) +COALESCE(co2_r.delivery_distances, 0))) / 1000.0),4)		
-            END)" => "co2e_intensity"
+            END)" => "co2e_intensity",
+            "(case when kln_ocean.order_from  ='public' and kln_ocean.transport_mode  ='sea' then (select customer_code from public.ocean_extend ex where ex.serial_no = kln_ocean.serial_no limit 1)
+                when kln_ocean.order_from  ='sfs' and kln_ocean.transport_mode  ='sea' then (select customer_code from sfs.ocean_extend ex where ex.serial_no = kln_ocean.serial_no limit 1)
+                when kln_ocean.order_from  ='public' and kln_ocean.transport_mode  ='air' then (select customer_code from public.air_extend ex where ex.serial_no = kln_ocean.serial_no limit 1)
+                when kln_ocean.order_from  ='sfs' and kln_ocean.transport_mode  ='air' then (select customer_code from sfs.air_extend ex where ex.serial_no = kln_ocean.serial_no limit 1)
+            else ''::text
+            end)" => "controlling_customer"
         ];
         return  $kln_ocean; 
     }
@@ -4937,7 +4943,7 @@ class common {
         'CO2e Intensity'             => ['co2_r'],
 
         // 特殊字段:依赖 oc + oe
-        'Controlling Customer'       => ['oo','Controlling Customer'],
+        //'Controlling Customer'       => ['oo','Controlling Customer'],
         'CARRIER TEU'                => ['oe','CARRIER TEU'],
 
         'Pickup-Postal Code'              => ['pickup'],
@@ -4988,14 +4994,14 @@ class common {
         }
         
         $needCustomerSQL = "";
-        if($needCustomer){
-            $needCustomerSQL = " case when oo.order_from  ='public' and oo.transport_mode  ='sea' then (select customer_code from public.ocean_extend ex where ex.serial_no = oo.serial_no limit 1)
-                when oo.order_from  ='sfs' and oo.transport_mode  ='sea' then (select customer_code from sfs.ocean_extend ex where ex.serial_no = oo.serial_no limit 1)
-                when oo.order_from  ='public' and oo.transport_mode  ='air' then (select customer_code from public.air_extend ex where ex.serial_no = oo.serial_no limit 1)
-                when oo.order_from  ='sfs' and oo.transport_mode  ='air' then (select customer_code from sfs.air_extend ex where ex.serial_no = oo.serial_no limit 1)
-            else ''::text
-            end as \"Controlling Customer\", ";
-        }
+        // if($needCustomer){
+        //     $needCustomerSQL = " case when oo.order_from  ='public' and oo.transport_mode  ='sea' then (select customer_code from public.ocean_extend ex where ex.serial_no = oo.serial_no limit 1)
+        //         when oo.order_from  ='sfs' and oo.transport_mode  ='sea' then (select customer_code from sfs.ocean_extend ex where ex.serial_no = oo.serial_no limit 1)
+        //         when oo.order_from  ='public' and oo.transport_mode  ='air' then (select customer_code from public.air_extend ex where ex.serial_no = oo.serial_no limit 1)
+        //         when oo.order_from  ='sfs' and oo.transport_mode  ='air' then (select customer_code from sfs.air_extend ex where ex.serial_no = oo.serial_no limit 1)
+        //     else ''::text
+        //     end as \"Controlling Customer\", ";
+        // }
 
         $needteuSQL = "";
         if($needteu){