|
|
@@ -1412,6 +1412,8 @@ class common {
|
|
|
'' 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";
|
|
|
+ //todo 这里预写个大概
|
|
|
+ //common::getTopBarSQL($toporiginType,$_REQUEST["transportation"]);
|
|
|
$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"])){
|
|
|
@@ -2058,5 +2060,73 @@ class common {
|
|
|
}
|
|
|
return $EDI315TimeAndLocation;
|
|
|
}
|
|
|
+
|
|
|
+ // public static function getAirSql($air_view,$type,$sql_where){
|
|
|
+ // $r3_r4_sql = "";
|
|
|
+ // if($type == 'ata_r3'){
|
|
|
+ // $r3_r4_sql = "select count(1) as count, '0 Day' as distext
|
|
|
+ // from ($air_view) aa where 1=1 $sql_where and ata >= etd and (ata-etd) >= 0 and (ata-etd) < 1
|
|
|
+ // union all
|
|
|
+ // select count(1) as count, '1-2 Days' as distext
|
|
|
+ // from ($air_view) aa where 1=1 $sql_where and ata >= etd and (ata-etd) >= 1 and (ata-etd) < 2
|
|
|
+ // union all
|
|
|
+ // select count(1) as count, '3-6 Days' as distext
|
|
|
+ // from ($air_view) aa where 1=1 $sql_where and ata >= etd and (ata-etd) >= 2 and (ata-etd) < 6
|
|
|
+ // union all
|
|
|
+ // select count(1) as count, '7 Days' as distext
|
|
|
+ // from ($air_view) aa where 1=1 $sql_where and ata >= etd and (ata-etd) >= 6";
|
|
|
+ // }
|
|
|
+ // if($type == 'atd_r4'){
|
|
|
+ // $r3_r4_sql ="select count(1) as count, ''0 Day'' as distext
|
|
|
+ // from ($air_view) aa where 1=1 $sql_where and atd >= etd and (atd-etd) >= 0 and (atd-etd) < 1
|
|
|
+ // union all
|
|
|
+ // select count(1) as count, ''1-2 Days'' as distext
|
|
|
+ // from ($air_view) aa where 1=1 $sql_where and atd >= etd and (atd-etd) >= 1 and (atd-etd) < 2
|
|
|
+ // union all
|
|
|
+ // select count(1) as count, ''3-6 Days'' as distext
|
|
|
+ // from ($air_view) aa where 1=1 $sql_where and atd >= etd and (atd-etd) >= 2 and (atd-etd) < 6
|
|
|
+ // union all
|
|
|
+ // select count(1) as count, ''7 Days'' as distext
|
|
|
+ // from ($air_view) aa where 1=1 $sql_where and and atd >= etd and (atd-etd) >= 6";
|
|
|
+ // }
|
|
|
+ // return $r3_r4_sql;
|
|
|
+ // }
|
|
|
+
|
|
|
+ // public static function getTopBarSQL($toporiginType,$transportation,$sqlWhere,$air_v){
|
|
|
+ // if(!is_array($transportation)){
|
|
|
+ // $transportation = array($transportation);
|
|
|
+ // }
|
|
|
+ // if(count($transportation) == 1 && strtolower($transportation[0]) == 'all' ){
|
|
|
+ // $transportation = array("Ocean","Air","Road");
|
|
|
+ // }
|
|
|
+ // //处理生成TopBarSQL
|
|
|
+ // $_tmp_table = "";
|
|
|
+ // foreach($transportation as $mode){
|
|
|
+ // if($mode == "Ocean"){
|
|
|
+ // if(empty($_tmp_table))
|
|
|
+ // $_tmp_table .= "select shippr_uncode,shipper_city from online_ocean where 1=1 and COALESCE(shippr_uncode,'')<>'' $sqlWhere";
|
|
|
+ // else
|
|
|
+ // $_tmp_table .= "union all select shippr_uncode,shipper_city from online_ocean where 1=1 and COALESCE(shippr_uncode,'')<>'' $sqlWhere";
|
|
|
+ // }
|
|
|
+ // if($mode == "Air"){
|
|
|
+ // if(empty($_tmp_table))
|
|
|
+ // $_tmp_table .= "select shippr_uncode,shipper_city from $air_v where 1=1 and COALESCE(shippr_uncode,'')<>'' $sqlWhere";
|
|
|
+ // else
|
|
|
+ // $_tmp_table .= "union all select shippr_uncode,shipper_city from $air_v where 1=1 and COALESCE(shippr_uncode,'')<>'' $sqlWhere";
|
|
|
+ // }
|
|
|
+ // if($mode == "Road"){
|
|
|
+
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // //虽然air 没有地图信息,但是坐标查询为空的过滤掉
|
|
|
+ // $TopBarSQL = "with aa as (select count(shippr_uncode) as num,shippr_uncode,
|
|
|
+ // (array_agg(shipper_city))[1] AS shipper_city from ($_tmp_table) as _tmp 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";
|
|
|
+ // return $TopBarSQL;
|
|
|
+ // }
|
|
|
}
|
|
|
?>
|