ShuanghongS пре 1 година
родитељ
комит
eaf5802707
3 измењених фајлова са 16 додато и 6 уклоњено
  1. 5 0
      main_new_version.php
  2. 3 0
      service/column.class.php
  3. 8 6
      service/ocean_order.class.php

+ 5 - 0
main_new_version.php

@@ -60,6 +60,11 @@ switch ($action) {
         common::echo_json_encode(200, $menuList);
         exit();
         break;
+    case 'main_filter':
+            $data  = common::getManagement();
+            common::echo_json_encode(200, $data['dashboard_filter']);
+            exit();
+            break;    
     case 'main_report':
         $type = $_REQUEST["r_type"];
         $container_type = $_REQUEST["container_type"];

+ 3 - 0
service/column.class.php

@@ -162,6 +162,9 @@ class column {
         $rss = common::removeTopOceanOldVersionSpecialField($rss);
         
         foreach ($rss as $v) {
+            if($v['database_column_name'] == "other_refenrence_no" && $model_name = "Ocean_Search"){
+                continue;
+            }
             if (empty($v['database_column_name'])) {
                 if ($sql == '')
                     $sql .= '\'' . $v['display_name'] . '\'';

+ 8 - 6
service/ocean_order.class.php

@@ -529,15 +529,15 @@ class ocean_order {
             $allBookingColumns = column::getInstance()->tableColumns('Ocean_Search',$allColumn);
         }
         $tp = ceil($rc / $ps);
-        $order_by = " etd desc NULLS LAST";
+        $order_by = " etd desc";
         if (_isCustomerLogin()) {
-            $order_by = " eta desc NULLS LAST";
+            $order_by = " eta desc";
         }
         if ($rc > 0) {
             $ocean_ref_sql = " LEFT JOIN LATERAL ( SELECT string_agg(ref_code ||ref_value, ', ') AS other_refenrence_no
-                            FROM public.ocean_reference temp WHERE temp.serial_no = online_ocean.serial_no) aa ON true ";
+                            FROM public.ocean_reference temp WHERE temp.serial_no = oo.serial_no) aa ON true ";
 
-            $sql = "SELECT order_from as _schemas,serial_no as __serial_no, serial_no,
+            $sql = "with oo  as (SELECT order_from as _schemas,serial_no as __serial_no, serial_no,
                     h_bol as _hbol, isf_bol as _isfbol, consignee_city as _consignee_city,
                     CASE
 	    	            WHEN (m_iffcpu is null and m_iffrec is null and m_iffdep is null and m_iffarr is null and m_iffafd is null) THEN 'Created'::text
@@ -547,8 +547,10 @@ class ocean_order {
                         WHEN (m_iffafd is not null) THEN 'Completed'::text
 	    	            ELSE 'Created'
 		            END AS new_status, ".
-                    column::getInstance()->getSearchSqlForDisplay('Ocean_Search') . " from public.online_ocean $ocean_ref_sql " . $sqlWhere . 
-                " order by $order_by limit " . $ps . " offset " . ($cp - 1) * $ps;
+                    column::getInstance()->getSearchSqlForDisplay('Ocean_Search') . " from public.online_ocean " . $sqlWhere . 
+                " order by $order_by limit " . $ps . " offset " . ($cp - 1) * $ps.") 
+            select oo.* ,aa.other_refenrence_no as \"Other refenrence No.\" from oo $ocean_ref_sql";
+            
             $rs = common::excuteListSql($sql);
             error_log("online_ocean_search_SQL: ".$sql);