Browse Source

10/16 commit

ShuanghongS 1 year ago
parent
commit
8460687369
2 changed files with 19 additions and 13 deletions
  1. 1 1
      main_new_version.php
  2. 18 12
      utils/common.class.php

+ 1 - 1
main_new_version.php

@@ -365,7 +365,7 @@ switch ($action) {
         break;
     case 'main_map_new':
         //修改添加port_of_transshipment 和port_of_transshipment_name的坐标获取(有为空的可能)
-        $serial_no = $_POST["serial_no"];
+        $serial_no = $_REQUEST["serial_no"];
         $sql = "with ss as (select '$serial_no' as sn)
                 , aa as (
                     select place_of_receipt_un, place_of_delivery_un, fport_of_loading_un, mport_of_discharge_un, port_of_loading, port_of_discharge, place_of_delivery_exp, place_of_receipt_exp,dd.*

+ 18 - 12
utils/common.class.php

@@ -1285,16 +1285,15 @@ class common {
                     null::timestamp without time zone as stime,''::text as ptype 
 				from vessel.vt_unlocode where lon<>0 and lat<>0 and lon is not null and lat is not null and uncode='".$orgin['shippr_uncode']."'";
             $map = common::excuteObjectSql($map_sql);   
-            // $json = '{"lng":"100.78594000","lat":"13.68521000","label":"'.$orgin['origin'].'","infor":"LAT KRABANG, THAILAND","sort":"0","stime":null,"ptype":"por"}';
-            // $map = json_decode($json,true); 
-
-            $toporiginMap[] = array("qandl"=>array($map['lng'],$map['lat']),
+             $json = '{"lng":"100.78594000","lat":"13.68521000","label":"'.$orgin['origin'].'","infor":"LAT KRABANG, THAILAND","sort":"0","stime":null,"ptype":"por"}';
+             $map = json_decode($json,true); 
+            $toporiginMap[] = array("qandl"=>array(floatval($map['lng']),floatval($map['lat'])),
                 "divIcon" => array("iconSize"=>0),
-                "name" =>$orgin['origin'],
+                "name" =>$orgin['shippr_uncode'],
                 "color" =>common::getItemStyle("top",$i),
                 "value" =>$orgin['num'],
                 "textcolor" =>"#FFF");
-            $toporigin[] = array("name"=>$orgin['origin'],"value"=>$orgin['num'],"color"=>common::getItemStyle("top",$i));
+            $toporigin[] = array("name"=>$orgin['shippr_uncode'],"value"=>$orgin['num'],"color"=>common::getItemStyle("top",$i));
             $origiNunMax = $origiNunMax < $orgin['num'] ? $orgin['num'] : $origiNunMax;
         }
 
@@ -1312,26 +1311,33 @@ class common {
             // $json = '{"lng":"100.78594000","lat":"13.68521000","label":"'.$agent['agent'].'","infor":"LAT KRABANG, THAILAND","sort":"0","stime":null,"ptype":"por"}';
             // $map = json_decode($json,true);
 
-            $toporiginMap[] = array("qandl"=>array($map['lng'],$map['lat']),
+            $topdestinationinMap[] = array("qandl"=>array(floatval($map['lng']),floatval($map['lat'])),
                 "divIcon" => array("iconSize"=>0),
-                "name" =>$orgin['origin'],
+                "name" =>$agent['consignee_uncode'],
                 "color" =>common::getItemStyle("top",$i),
                 "value" =>$agent['num'],
                 "textcolor" =>"#FFF");
-            $topdestination[] = array("name"=>$agent['agent'],"value"=>$agent['num'],"color"=>common::getItemStyle("top",$i));
+            $topdestination[] = array("name"=>$agent['consignee_uncode'],"value"=>$agent['num'],"color"=>common::getItemStyle("top",$i));
             $agentiNunMax = $agentiNunMax < $agent['num'] ? $agent['num'] : $agentiNunMax;
         }
 
         //处理返回原表数据格式
-        $maximum_of_both = $origiNunMax >$agentiNunMax ? $origiNunMax : $agentiNunMax;
-        $interval = utils::calculateTicks(0,$maximum_of_both,10);
+        $interval = utils::calculateTicks(0,$origiNunMax,10);
         if($interval == 0){
             //处理返回默认值
             $interval = 1;
         }
+
+        $dest_interval = utils::calculateTicks(0,$agentiNunMax,10);
+        if($dest_interval == 0){
+            //处理返回默认值
+            $dest_interval = 1;
+        }
+
         $returnData = array("seller_data_list_origin"=>$toporigin,"toporiginMap"=>$toporiginMap,
             "seller_data_list_destination"=>$topdestination,"topdestinationinMap"=>$topdestinationinMap,
-            "min" => 0,"Max" =>$interval*10,"interval" =>$interval);
+            "min" => 0,"Max" =>$interval*10,"interval" =>$interval,
+            "dest_min" => 0,"dest_Max" =>$dest_interval*10,"dest_interval" =>$dest_interval);
         return $returnData;
     }