ShuanghongS 1 月之前
父節點
當前提交
5e84a606c4
共有 1 個文件被更改,包括 25 次插入5 次删除
  1. 25 5
      service/ocean_order.class.php

+ 25 - 5
service/ocean_order.class.php

@@ -1100,9 +1100,19 @@ class ocean_order {
                 . $sqlWhere . " order by $order_by limit " . $ps . " offset " . ($cp - 1) * $ps.") 
             select oo.* ,
                 case when oo.transport_mode ='sea'  and oo._schemas ='public'
-                        then ( SELECT string_agg(ref_code ||ref_value, ', ') AS other_refenrence_no FROM public.ocean_reference temp WHERE temp.serial_no = oo.serial_no)
+                        then ( SELECT string_agg(ref_code ||ref_value, ', ') AS other_refenrence_no FROM public.ocean_reference temp 
+                                    WHERE temp.ref_code <> 'PO' 
+                                            AND COALESCE(temp.ref_value,'')<>''
+                                            AND temp.ref_value IS NOT NULL  
+                                            AND LENGTH(TRIM(BOTH FROM temp.ref_value)) > 0  
+                                            AND temp.serial_no = oo.serial_no)
                     when oo.transport_mode ='sea'   and oo._schemas ='sfs'
-                        then ( SELECT string_agg(ref_code ||ref_value, ', ') AS other_refenrence_no FROM sfs.ocean_reference temp WHERE temp.serial_no = oo.serial_no)    
+                        then ( SELECT string_agg(ref_code ||ref_value, ', ') AS other_refenrence_no FROM sfs.ocean_reference temp 
+                                    WHERE temp.ref_code <> 'PO' 
+                                            AND COALESCE(temp.ref_value,'')<>''
+                                            AND temp.ref_value IS NOT NULL  
+                                            AND LENGTH(TRIM(BOTH FROM temp.ref_value)) > 0 
+                                            AND temp.serial_no = oo.serial_no)    
                     when oo.transport_mode ='air' 
                         then ''
                     else '' 
@@ -1129,10 +1139,20 @@ class ocean_order {
                     FROM public.kln_ocean_extend oe WHERE oe.serial_no::text = kln_ocean.serial_no::text and oe.order_from::text = kln_ocean.order_from::text) oe ON true " 
                 . $sqlWhere . " order by $order_by) 
            select oo.* ,
-                case when oo.transport_mode ='sea'  and oo._schemas ='public'
-                        then ( SELECT string_agg(ref_code ||ref_value, ', ') AS other_refenrence_no FROM public.ocean_reference temp WHERE temp.serial_no = oo.serial_no)
+                 case when oo.transport_mode ='sea'  and oo._schemas ='public'
+                        then ( SELECT string_agg(ref_code ||ref_value, ', ') AS other_refenrence_no FROM public.ocean_reference temp 
+                                    WHERE temp.ref_code <> 'PO' 
+                                            AND COALESCE(temp.ref_value,'')<>''
+                                            AND temp.ref_value IS NOT NULL  
+                                            AND LENGTH(TRIM(BOTH FROM temp.ref_value)) > 0  
+                                            AND temp.serial_no = oo.serial_no)
                     when oo.transport_mode ='sea'   and oo._schemas ='sfs'
-                        then ( SELECT string_agg(ref_code ||ref_value, ', ') AS other_refenrence_no FROM sfs.ocean_reference temp WHERE temp.serial_no = oo.serial_no)    
+                        then ( SELECT string_agg(ref_code ||ref_value, ', ') AS other_refenrence_no FROM sfs.ocean_reference temp 
+                                    WHERE temp.ref_code <> 'PO' 
+                                            AND COALESCE(temp.ref_value,'')<>''
+                                            AND temp.ref_value IS NOT NULL  
+                                            AND LENGTH(TRIM(BOTH FROM temp.ref_value)) > 0 
+                                            AND temp.serial_no = oo.serial_no)    
                     when oo.transport_mode ='air' 
                         then ''
                     else ''