ShuanghongS 1 vuosi sitten
vanhempi
commit
3303ceb0d1

+ 7 - 0
libs/map_config.ini.php

@@ -18,6 +18,13 @@ if ($_SESSION['ONLINE_USER']['is_demo'] == "t") {
     $_CBP_DB['dbname'] = 'redant_online';
     $_CBP_DB['port'] = '5437';
     $_CBP_DB['type'] = 'postgres';
+
+    // $_CBP_DB['host'] = '192.168.0.121';
+    // $_CBP_DB['username'] = 'root';
+    // $_CBP_DB['password'] = '123456';
+    // $_CBP_DB['dbname'] = 'online_t_1125';
+    // $_CBP_DB['port'] = '5434';
+    // $_CBP_DB['type'] = 'postgres';
 }
 
 $mapdb_url = "host=" . $_CBP_DB['host'] . " port=" . $_CBP_DB['port'] . " dbname=" . $_CBP_DB['dbname'] . " user=" . $_CBP_DB['username'] . " password=" . $_CBP_DB['password'];

+ 16 - 16
main_new_version.php

@@ -587,7 +587,7 @@ switch ($action) {
         exit();
         break;
     case 'main_map_new':
-        include ONLINE_ROOT . 'libs' . DS . 'map_config.ini.php';
+        //include ONLINE_ROOT . 'libs' . DS . 'map_config.ini.php';
         //修改添加port_of_transshipment 和port_of_transshipment_name的坐标获取(有为空的可能)
         $serial_no = $_REQUEST["serial_no"];
         //$serial_no = "F41E6016-1A97-4C93-8198-53D8B3B26220";
@@ -620,21 +620,21 @@ switch ($action) {
         //           {"lng":"100.88333333","lat":"13.08333333","label":"Destination","infor":"LAEM CHABANG PORT,THAILAND","sort":"1","stime":null,"ptype":"pol"},
         //           {"lng":"-122.28640000","lat":"37.79784000","label":"Transfer","infor":"OAKLAND, CA, USA","sort":"2","stime":null,"ptype":"pod"}]';
         //$rss = json_decode($json,true);
-        global $mapdb;
-        //查询线(包含所有的线)
-        $Line = $mapdb->GetAll("select * from get_track_data('$serial_no',true)");
-        $solidLine = array();
-        $dottedLine = array();
-        foreach($Line as $line){
-            if($line['tp'] == "1"){
-                $solidLine[] = $line;
-            }else{
-                $dottedLine[] = $line;
-            }
-        }
-        $data = array("point"=>$rss,"solidLine"=>$solidLine,"dottedLine"=>$dottedLine);
-        common::echo_json_encode(200, $data);
-        //common::echo_json_encode(200, $rss);
+        // global $mapdb;
+        // //查询线(包含所有的线)
+        // $Line = $mapdb->GetAll("select * from get_track_data('$serial_no',true)");
+        // $solidLine = array();
+        // $dottedLine = array();
+        // foreach($Line as $line){
+        //     if($line['tp'] == "1"){
+        //         $solidLine[] = $line;
+        //     }else{
+        //         $dottedLine[] = $line;
+        //     }
+        // }
+        // $data = array("point"=>$rss,"solidLine"=>$solidLine,"dottedLine"=>$dottedLine);
+        // common::echo_json_encode(200, $data);
+        common::echo_json_encode(200, $rss);
         exit();
         break;
     case 'main_welcome':

+ 2 - 1
service/login.class.php

@@ -1150,7 +1150,8 @@ class login {
             $reference_number_lower = strtolower($reference_number);
             $online_ocean_sql = "select serial_no,order_from from online_ocean 
                 where ((ARRAY['$reference_number_lower'] && array_append(ARRAY[lower(booking_no::text), lower(h_bol::text), lower(m_bol), lower(carrier_booking), lower(quote_no), lower(tracking_no)]||string_to_array(lower(ctnrs),','), ''::text))
-                    or text_search @@ (str_to_tsquery('$reference_number')))";
+                    or po_no ilike '%$reference_number%'
+                    or invoice_no ilike '%$reference_number%')";
             $online_ocean_arr = common::excuteListSql($online_ocean_sql);        
             if(empty($online_ocean_arr)){
                 $data = array("msg" =>"No matches");

+ 1 - 1
service/ocean_booking.class.php

@@ -154,7 +154,7 @@ class ocean_booking {
             $more_param = common::getInNotInSqlForSearch(strtolower(implode(';',$textSearch_arr)));
             //$sqlWhere .= " and (ARRAY[$more_param] && array_append(array[lower(booking_no)::text,lower(h_bol)::text, lower(po_no),lower(carrier_booking)],''))"; 
             $sqlWhere .= " and ((ARRAY[$more_param] && array_append(array[lower(booking_no)::text,lower(h_bol)::text, lower(po_no),lower(carrier_booking)],''))
-                or text_search @@ (str_to_tsquery('" . common::check_input($_POST["_textSearch"]) . "')))"; 
+                or po_no ilike '%" . common::check_input($_POST["_textSearch"]) . "%')"; 
         } 
         //为了移除filterTag条件
         $sqlWhere_befrom_filterTag  = $sqlWhere;

+ 4 - 2
service/ocean_order.class.php

@@ -397,9 +397,11 @@ class ocean_order {
             //     $sqlWhere .= " and ($more_sql)";
             // }
             $more_param = common::getInNotInSqlForSearch(strtolower(implode(';',$textSearch_arr)));
+            // or text_search @@ (str_to_tsquery('" . common::check_input($_POST["_textSearch"]) . "'))
             //$sqlWhere .= " and (ARRAY[$more_param] && array_append(array[lower(booking_no)::text,lower(h_bol)::text, lower(po_no),lower(carrier_booking),lower(tracking_no)],''))";
-            $sqlWhere .= " and ((ARRAY[$more_param] && array_append(ARRAY[lower(booking_no::text), lower(h_bol::text), lower(m_bol), lower(carrier_booking), lower(quote_no), lower(tracking_no)]||string_to_array(lower(ctnrs),','), ''::text)) 
-                or text_search @@ (str_to_tsquery('" . common::check_input($_POST["_textSearch"]) . "')))";
+            $sqlWhere .= " and ((ARRAY[$more_param] && array_append(ARRAY[lower(booking_no::text), lower(h_bol::text), lower(m_bol), lower(carrier_booking), lower(quote_no), lower(tracking_no)]||string_to_array(lower(ctnrs),','), ''::text))
+                or po_no ilike '%" . common::check_input($_POST["_textSearch"]) . "%'
+                or invoice_no ilike '%" . common::check_input($_POST["_textSearch"]) . "%')";
         }
         //移除filterTag
         $sqlWhere_befrom_filterTag  = $sqlWhere;

+ 20 - 3
utils/common.class.php

@@ -1546,9 +1546,19 @@ class common {
 
     public static function getRevenue(){
         $data = '{"bar_title":"Total: 0","barList":["DEC,23","JAN,24","FEB,24","MAR,24","APR,24","MAY,24","JUN,24","JUL,24","AUG,24","SEP,24","OCT,24","NOV,24"],"barSeries":[{"name":"USD","type":"bar","data":[1,1,1,1,1,1,1,1,1,1,1,1],"emphasis":{"disabled":true,"focus":"none"},"itemStyle":{"color":"#FF7500","borderRadius":6},"label":{"show":false,"color":"#646A73","position":"top","fontFamily":"Lato-Light","hideWhenMouseLeave":false}},{"name":"THB","type":"bar","data":[2,2,2,2,2,2,2,2,2,2,2,2],"emphasis":{"disabled":true,"focus":"none"},"itemStyle":{"color":"#FFAC66","borderRadius":6},"label":{"show":false,"color":"#646A73","position":"top","fontFamily":"Lato-Light","hideWhenMouseLeave":false}},{"name":"SGD","type":"bar","data":[3,3,3,3,3,3,3,3,3,3,3,3],"emphasis":{"disabled":true,"focus":"none"},"itemStyle":{"color":"#FFE3CC","borderRadius":6},"label":{"show":false,"color":"#646A73","position":"top","fontFamily":"Lato-Light","hideWhenMouseLeave":false}}],"Max":5,"interval":1,"download_name":"Rvenue","isShowTooltips":true}';   
-        // global $db;
-        // $param = '{"user_login":"","report_type":"ALL","date_from":"2024-01-01","date_to":"2024-12-31"}';
-        // $r1 = $db->Execute("SELECT * FROM get_customer_revenue_report('$param');FETCH ALL FROM r2;");
+        // $date_from = null;
+        // $date_to = null;
+        // if (isset($_REQUEST['date_start']) && !empty($_REQUEST['date_start'])){
+        //     $date_start = common::dateFormatToYM($_REQUEST['date_start']);
+        //     $date_from = $date_start."-01";
+        // }
+        // if (isset($_REQUEST['date_end']) && !empty($_REQUEST['date_end'])){
+        //     $date_end = common::dateFormatToYM($_REQUEST['date_end']);
+        //     $date_to = date('Y-m-t', strtotime("$date_end-01"));
+        // }
+        // $param = '{"user_login":"'._getLoginName().'","report_type":"ALL","date_from":"2024-01-01","date_to":"2024-12-31"}';
+        // $sql = "SELECT * FROM get_customer_revenue_report('$param');FETCH ALL FROM r2;";
+        // common::excuteListSql($sql);
         return json_decode($data,true); 
     }
 
@@ -1604,6 +1614,13 @@ class common {
         $_SESSION = array();
     }
 
+
+    public static function dateFormatToYM($dateString){
+        $date = DateTime::createFromFormat('m/Y', $dateString);
+        $formattedDate = $date->format('Y-m'); // YYYY-MM
+        return $formattedDate;
+    }
+
     public static function retStationInfo($address_1,$address_2,$address_3,$address_4,$city,$state,$country,$zipcode){
         $stationInfo = "";
         if(!empty($address_1)){