ShuanghongS 4 주 전
부모
커밋
cb2b7d900c
1개의 변경된 파일7개의 추가작업 그리고 5개의 파일을 삭제
  1. 7 5
      service/destination_delivery.class.php

+ 7 - 5
service/destination_delivery.class.php

@@ -804,13 +804,15 @@ class destination_delivery {
             $month = common::check_input($_POST ['month']); //current_page
             $consignee = common::check_input($_POST ['consignee']);
             $sqlWhere = ' where ' . common::searchExtendHand_KLN("ocean", $_SESSION["ONLINE_USER"]);
+
+            $sqlWhere_bk= $sqlWhere;
+            $sqlKNDDWhere = "and exists(select 1 from public.kln_ocean ". $sqlWhere_bk."  and kln_ocean.serial_no = any(kln_destination_delivery.h_serial_no) limit 1)";
+
             //兜底规则
-            $sqlWhere .= " and eta >= now() - INTERVAL '6 months' and eta <= now() + INTERVAL '6 months'";
+            $sqlWhere .= " and eta >= now() - INTERVAL '3 months' and eta <= now() + INTERVAL '1 months'";
             if(!empty($consignee)){
                 $sqlWhere .= " and consignee ilike '%".$consignee."%'";
             }
-            $sqlKNDDWhere = "and exists(select 1 from public.kln_ocean ". $sqlWhere."  and kln_ocean.serial_no = any(kln_destination_delivery.h_serial_no) limit 1)";
-            
             $search_calendar_sql = common::excuteOneSql("select item_value from public.config where item = 'Destination_Bookings_Calendar_Sql'");
 
             //日期计算
@@ -1348,7 +1350,7 @@ class destination_delivery {
         //根據用戶的賬號權限所能看到的全部shipment數據的目的地站點,去匹配是否有開通destination delivery的服務,如果未開通,則展示此提示頁面
         //兜底规则
         $sqlWhere = $sqlWhere_common;
-        $sqlWhere .= " and  eta >= now() - INTERVAL '6 months' and eta <= now() + INTERVAL '6 months'";
+        $sqlWhere .= " and  eta >= now() - INTERVAL '3 months' and eta <= now() + INTERVAL '1 months'";
         $checkOpenSql = "select station from public.kln_destination_delivery_config dc
                             where exists(select 1 from  
                                     public.kln_ocean oo ". $sqlWhere." 
@@ -1361,7 +1363,7 @@ class destination_delivery {
         
         //根據用戶的賬號權限所能看到的全部shipment數據的目的地站點,去匹配是否有開通destination delivery的服務,如果有開通,但沒有符合條件的shipment,則展示此提示頁面
         $sqlWhere = $sqlWhere_common;
-        $sqlWhere .= " and  eta >= now() - INTERVAL '6 months' and eta <= now() + INTERVAL '6 months'";
+        $sqlWhere .= " and  eta >= now() - INTERVAL '3 months' and eta <= now() + INTERVAL '1 months'";
 
         $text_search = $_REQUEST['text_search'];
         if (!empty($text_search)){