|
|
@@ -1207,12 +1207,12 @@ class common {
|
|
|
//这里的问题跟 top 一样 。总的排放量查询有问题。目前是总的排放量 暂时等于 sea的排放量
|
|
|
if ($type == "co2e_orgin"){
|
|
|
$co2e_shippr_sql = "select SUM(COALESCE(carbon_emission,0)) as catnum ,
|
|
|
- shippr_uncode as station from kln_ocean where 1=1 and COALESCE(shippr_uncode,'')<>'' and carbon_emission is not null $sqlWhere group by shippr_uncode order by catnum desc limit 10";
|
|
|
+ shippr_uncode as station from public.kln_ocean where 1=1 and COALESCE(shippr_uncode,'')<>'' and carbon_emission is not null $sqlWhere group by shippr_uncode order by catnum desc limit 10";
|
|
|
$co2e_aLL = common::excuteListSql($co2e_shippr_sql);
|
|
|
}
|
|
|
if ($type == "co2e_destination"){
|
|
|
$co2e_consignee_sql = "select SUM(COALESCE(carbon_emission,0)) as catnum ,
|
|
|
- consignee_uncode as station from kln_ocean where 1=1 and COALESCE(consignee_uncode,'')<>'' and carbon_emission is not null $sqlWhere group by consignee_uncode order by catnum desc limit 10";
|
|
|
+ consignee_uncode as station from public.kln_ocean where 1=1 and COALESCE(consignee_uncode,'')<>'' and carbon_emission is not null $sqlWhere group by consignee_uncode order by catnum desc limit 10";
|
|
|
$co2e_aLL = common::excuteListSql($co2e_consignee_sql);
|
|
|
}
|
|
|
//最大Y值
|
|
|
@@ -1304,7 +1304,7 @@ class common {
|
|
|
|
|
|
$toporiginType = "shippr_uncode";
|
|
|
$shippr_uncode_10_sql ="with aa as (select count(shippr_uncode) as num,shippr_uncode,
|
|
|
- (array_agg(shipper_city))[1] AS shipper_city from kln_ocean
|
|
|
+ (array_agg(shipper_city))[1] AS shipper_city from public.kln_ocean
|
|
|
where 1=1 and COALESCE(shippr_uncode,'')<>'' $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,
|
|
|
@@ -1318,7 +1318,7 @@ class common {
|
|
|
if(count($shippr_uncode_10) == 1 && empty($shippr_uncode_10[0]["shippr_uncode"])){
|
|
|
$toporiginType = "fport_of_loading_un";
|
|
|
$shippr_uncode_10_sql = "with aa as (select count(fport_of_loading_un) as num,fport_of_loading_un as shippr_uncode
|
|
|
- from kln_ocean where 1=1 and COALESCE(fport_of_loading_un,'')<>'' $sqlWhere group by fport_of_loading_un order by num desc limit 10)
|
|
|
+ from public.kln_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,
|
|
|
@@ -1331,7 +1331,7 @@ class common {
|
|
|
$topdestinationinType = "consignee_uncode";
|
|
|
$consignee_uncode_10_sql = "with aa as (select count(consignee_uncode) as num,consignee_uncode,
|
|
|
(array_agg(consignee_city))[1] AS consignee_city
|
|
|
- from kln_ocean where 1=1 and COALESCE(consignee_uncode,'')<>'' $sqlWhere group by consignee_uncode order by num desc limit 10)
|
|
|
+ from public.kln_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,
|
|
|
@@ -1342,7 +1342,7 @@ class common {
|
|
|
//如果值没有:客户地址-->站点地址-->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 = "with aa as (select count(mport_of_discharge_un) as num,mport_of_discharge_un as consignee_uncode from kln_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 public.kln_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,
|