|
|
@@ -1148,7 +1148,7 @@ class common {
|
|
|
if(stripos("Today", $arr['name']) !== false){
|
|
|
$color = common::getItemStyle($type,"Today");
|
|
|
if(empty($data_kd["0"])){
|
|
|
- $data_kd["0"] = array("value" =>intval($arr['value']),"name" =>"0 Day","itemStyle" =>array("color" =>$color));
|
|
|
+ $data_kd["0"] = array("value" =>intval($arr['value']),"name" =>"≤1 Day","itemStyle" =>array("color" =>$color));
|
|
|
}else{
|
|
|
$data_kd["0"]["value"] = $data_kd["0"]["value"] + intval($arr['value']);
|
|
|
}
|
|
|
@@ -1172,17 +1172,17 @@ class common {
|
|
|
if(stripos("+7 Days/Over 7 Days", $arr['name']) !== false){
|
|
|
$color = common::getItemStyle($type,"7 Days");
|
|
|
if(empty($data_kd["3"])){
|
|
|
- $data_kd["3"] = array("value" =>intval($arr['value']),"name" =>"7 Days","itemStyle" =>array("color" =>$color));
|
|
|
+ $data_kd["3"] = array("value" =>intval($arr['value']),"name" =>"≥7 Days","itemStyle" =>array("color" =>$color));
|
|
|
}else{
|
|
|
$data_kd["3"]["value"] = $data_kd["3"]["value"] + intval($arr['value']);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
if($type == 'r4'){
|
|
|
- $data = array("ETDList" =>$data_kd,"ETD_Radius"=>array('30%','50%'),"title1" =>"Departure","title2" =>"(ATD-ETD)","download_name" => "Pending Departure");
|
|
|
+ $data = array("ETDList" =>$data_kd,"ETD_Radius"=>array('30%','50%'),"title1" =>"Departure","title2" =>"","download_name" => "Pending Departure");
|
|
|
}
|
|
|
if($type == 'r3'){
|
|
|
- $data = array("ETDList" =>$data_kd,"ETD_Radius"=>array('30%','50%'),"title1" =>"Arrival","title2" =>"(ATA-ETD)","download_name" => "Pending Arrival");
|
|
|
+ $data = array("ETDList" =>$data_kd,"ETD_Radius"=>array('30%','50%'),"title1" =>"Arrival","title2" =>"","download_name" => "Pending Arrival");
|
|
|
}
|
|
|
|
|
|
}
|
|
|
@@ -1276,27 +1276,55 @@ class common {
|
|
|
$sqlWhere = " " . $sqlWhere;
|
|
|
|
|
|
$toporiginType = "shippr_uncode";
|
|
|
- $shippr_uncode_10_sql = "select count(shippr_uncode) as num,shippr_uncode,
|
|
|
- (array_agg(shipper_city))[1] AS shipper_city from online_ocean
|
|
|
- where 1=1 and COALESCE(shippr_uncode)<>'' $sqlWhere group by shippr_uncode order by num desc limit 10";
|
|
|
+ // $shippr_uncode_10_sql = "select count(shippr_uncode) as num,shippr_uncode,
|
|
|
+ // (array_agg(shipper_city))[1] AS shipper_city from online_ocean
|
|
|
+ // where 1=1 and COALESCE(shippr_uncode)<>'' $sqlWhere group by shippr_uncode order by num desc limit 10";
|
|
|
+ $shippr_uncode_10_sql ="with aa as (select count(shippr_uncode) as num,shippr_uncode,
|
|
|
+ (array_agg(shipper_city))[1] AS shipper_city from online_ocean
|
|
|
+ where 1=1 and COALESCE(shippr_uncode)<>'' and $sqlWhere group by shippr_uncode order by num desc limit 10)
|
|
|
+ select aa.*,dd.* from aa
|
|
|
+ left join LATERAL ( select lon as lng, lat as lat,
|
|
|
+ '' as label, '' as infor, 3 as sort,
|
|
|
+ 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=aa.shippr_uncode ) dd on true";
|
|
|
$shippr_uncode_10 = common::excuteListSql($shippr_uncode_10_sql);
|
|
|
//如果值没有:客户地址-->站点地址-->Port地址(POL/POD)
|
|
|
if(count($shippr_uncode_10) == 1 && empty($shippr_uncode_10[0]["shippr_uncode"])){
|
|
|
$toporiginType = "fport_of_loading_un";
|
|
|
- $shippr_uncode_10_sql = "select count(fport_of_loading_un) as num,fport_of_loading_un as shippr_uncode from online_ocean where 1=1 and COALESCE(fport_of_loading_un)<>'' $sqlWhere group by fport_of_loading_un order by num desc limit 10";
|
|
|
+ $shippr_uncode_10_sql = "with aa as (select count(fport_of_loading_un) as num,fport_of_loading_un as shippr_uncode
|
|
|
+ from online_ocean where 1=1 and COALESCE(fport_of_loading_un)<>'' $sqlWhere group by fport_of_loading_un order by num desc limit 10)
|
|
|
+ select aa.*,dd.* from aa
|
|
|
+ left join LATERAL ( select lon as lng, lat as lat,
|
|
|
+ '' as label, '' as infor, 3 as sort,
|
|
|
+ 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=aa.shippr_uncode ) dd on true";
|
|
|
$shippr_uncode_10 = common::excuteListSql($shippr_uncode_10_sql);
|
|
|
}
|
|
|
//$toporiginType = "fport_of_loading_un";
|
|
|
|
|
|
$topdestinationinType = "consignee_uncode";
|
|
|
- $consignee_uncode_10_sql = "select count(consignee_uncode) as num,consignee_uncode,
|
|
|
- (array_agg(consignee_city))[1] AS consignee_city
|
|
|
- from online_ocean where 1=1 and COALESCE(consignee_uncode)<>'' $sqlWhere group by consignee_uncode order by num desc limit 10";
|
|
|
+ // $consignee_uncode_10_sql = "select count(consignee_uncode) as num,consignee_uncode,
|
|
|
+ // (array_agg(consignee_city))[1] AS consignee_city
|
|
|
+ // from online_ocean where 1=1 and COALESCE(consignee_uncode)<>'' $sqlWhere group by consignee_uncode order by num desc limit 10";
|
|
|
+ $consignee_uncode_10_sql = "with aa as (select count(consignee_uncode) as num,consignee_uncode,
|
|
|
+ (array_agg(consignee_city))[1] AS consignee_city
|
|
|
+ from online_ocean where 1=1 and COALESCE(consignee_uncode)<>'' $sqlWhere group by consignee_uncode order by num desc limit 10)
|
|
|
+ select aa.*,dd.* from aa
|
|
|
+ left join LATERAL ( select lon as lng, lat as lat,
|
|
|
+ '' as label, '' as infor, 3 as sort,
|
|
|
+ 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=aa.consignee_uncode ) dd on true";
|
|
|
+
|
|
|
$consignee_uncode_10 = common::excuteListSql($consignee_uncode_10_sql);
|
|
|
//如果值没有:客户地址-->站点地址-->Port地址(POL/POD)
|
|
|
if(count($consignee_uncode_10) == 1 && empty($consignee_uncode_10[0]["consignee_uncode"])){
|
|
|
$topdestinationinType = "mport_of_discharge_un";
|
|
|
- $consignee_uncode_10_sql = "select count(mport_of_discharge_un) as num,mport_of_discharge_un as consignee_uncode from online_ocean where 1=1 and COALESCE(mport_of_discharge_un)<>'' $sqlWhere group by mport_of_discharge_un order by num desc limit 10";
|
|
|
+ $consignee_uncode_10_sql = "with aa as (select count(mport_of_discharge_un) as num,mport_of_discharge_un as consignee_uncode from online_ocean where 1=1 and COALESCE(mport_of_discharge_un)<>'' $sqlWhere group by mport_of_discharge_un order by num desc limit 10)
|
|
|
+ select aa.*,dd.* from aa
|
|
|
+ left join LATERAL ( select lon as lng, lat as lat,
|
|
|
+ '' as label, '' as infor, 3 as sort,
|
|
|
+ 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=aa.consignee_uncode ) dd on true";
|
|
|
$consignee_uncode_10 = common::excuteListSql($consignee_uncode_10_sql);
|
|
|
}
|
|
|
|
|
|
@@ -1306,11 +1334,7 @@ class common {
|
|
|
$origiNunMax = 0;
|
|
|
foreach($shippr_uncode_10 as $orgin){
|
|
|
$i = $i + 1;
|
|
|
- $map_sql = "select lon as lng, lat as lat,
|
|
|
- '' as label, '' as infor, 3 as sort,
|
|
|
- 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);
|
|
|
+ $map = array("lat" =>$orgin['lat'],"lng" =>$orgin['lng']);
|
|
|
//$json = '{"lng":121.8525,"lat":29.926545,"label":"'.$orgin['origin'].'","infor":"LAT KRABANG, THAILAND","sort":"0","stime":null,"ptype":"por"}';
|
|
|
//$map = json_decode($json,true);
|
|
|
if(!empty($map)){
|
|
|
@@ -1337,11 +1361,7 @@ class common {
|
|
|
$agentiNunMax = 0;
|
|
|
foreach($consignee_uncode_10 as $agent){
|
|
|
$i = $i + 1;
|
|
|
- $map_sql = "select lon as lng, lat as lat,
|
|
|
- '' as label, '' as infor, 3 as sort,
|
|
|
- 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='".$agent['consignee_uncode']."'";
|
|
|
- $map = common::excuteObjectSql($map_sql);
|
|
|
+ $map = array("lat" =>$agent['lat'],"lng" =>$agent['lng']);
|
|
|
// $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);
|
|
|
if(!empty($map)){
|