|
@@ -200,14 +200,16 @@ class common {
|
|
|
{
|
|
{
|
|
|
return "1=1";
|
|
return "1=1";
|
|
|
}
|
|
}
|
|
|
- return " (schem_not_display is null or schem_not_display=false)";
|
|
|
|
|
|
|
+ //return " (schem_not_display is null or schem_not_display=false)";
|
|
|
|
|
+ return " (COALESCE(schem_not_display,false) = false)";
|
|
|
}
|
|
}
|
|
|
if (_isDocAdmin($user["user_login"])) {
|
|
if (_isDocAdmin($user["user_login"])) {
|
|
|
if(strtolower($type) == "air_booking" ) //|| strtolower($type) == "air"
|
|
if(strtolower($type) == "air_booking" ) //|| strtolower($type) == "air"
|
|
|
{
|
|
{
|
|
|
return "1=1";
|
|
return "1=1";
|
|
|
}
|
|
}
|
|
|
- return ' (schem_not_display is null or schem_not_display=false)';
|
|
|
|
|
|
|
+ //return ' (schem_not_display is null or schem_not_display=false)';
|
|
|
|
|
+ return ' (COALESCE(schem_not_display,false) = false)';
|
|
|
}
|
|
}
|
|
|
if (strtolower($type) != "ocean" && strtolower($type) != "booking" && strtolower($type) != "air_booking"&& strtolower($type) != "air") {
|
|
if (strtolower($type) != "ocean" && strtolower($type) != "booking" && strtolower($type) != "air_booking"&& strtolower($type) != "air") {
|
|
|
return " 1<>1";
|
|
return " 1<>1";
|
|
@@ -436,6 +438,31 @@ class common {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ public static function getInNotInSqlForSearch($contact_id, $type = 'in') {
|
|
|
|
|
+ if (empty($contact_id))
|
|
|
|
|
+ return " =''";
|
|
|
|
|
+ $contact_id = trim($contact_id);
|
|
|
|
|
+ $contact_id = trim($contact_id, ";");
|
|
|
|
|
+ $contact_id = trim($contact_id);
|
|
|
|
|
+ $contact_id = strtolower($contact_id);
|
|
|
|
|
+ if ($type == 'in') {
|
|
|
|
|
+ if (utils::checkExist($contact_id, ";")) {
|
|
|
|
|
+ $ss = "";
|
|
|
|
|
+ $aa = explode(";", $contact_id);
|
|
|
|
|
+ foreach ($aa as $k => $v) {
|
|
|
|
|
+ $v = trim($v);
|
|
|
|
|
+ if (empty($ss))
|
|
|
|
|
+ $ss = "'" . common::check_input($v) . "'";
|
|
|
|
|
+ else
|
|
|
|
|
+ $ss .= ",'" . common::check_input($v) . "'";
|
|
|
|
|
+ }
|
|
|
|
|
+ return $ss;
|
|
|
|
|
+ } else {
|
|
|
|
|
+ return "'" . common::check_input($contact_id) . "'";
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
/*
|
|
/*
|
|
|
* Encrypt a SQL query statement used to be passed as a parameter to get excel output
|
|
* Encrypt a SQL query statement used to be passed as a parameter to get excel output
|
|
|
encode :DeCode('str','E');
|
|
encode :DeCode('str','E');
|
|
@@ -1202,12 +1229,12 @@ class common {
|
|
|
//先查询总的排放量sea air road,确定排名后,在分别查询对应的sea air road
|
|
//先查询总的排放量sea air road,确定排名后,在分别查询对应的sea air road
|
|
|
if ($type == "co2e_orgin"){
|
|
if ($type == "co2e_orgin"){
|
|
|
$co2e_shippr_sql = "select SUM(COALESCE(carbon_emission,0)::numeric(12,10)) as catnum ,
|
|
$co2e_shippr_sql = "select SUM(COALESCE(carbon_emission,0)::numeric(12,10)) as catnum ,
|
|
|
- shippr_uncode as station from online_ocean where 1=1 and COALESCE(shippr_uncode)<>'' $sqlWhere group by shippr_uncode order by catnum desc limit 10";
|
|
|
|
|
|
|
+ shippr_uncode as station from online_ocean where 1=1 and COALESCE(shippr_uncode,'')<>'' $sqlWhere group by shippr_uncode order by catnum desc limit 10";
|
|
|
$co2e_aLL = common::excuteListSql($co2e_shippr_sql);
|
|
$co2e_aLL = common::excuteListSql($co2e_shippr_sql);
|
|
|
}
|
|
}
|
|
|
if ($type == "co2e_destination"){
|
|
if ($type == "co2e_destination"){
|
|
|
$co2e_consignee_sql = "select SUM(COALESCE(carbon_emission,0)::numeric(12,10)) as catnum,
|
|
$co2e_consignee_sql = "select SUM(COALESCE(carbon_emission,0)::numeric(12,10)) as catnum,
|
|
|
- consignee_uncode as station from online_ocean where 1=1 and COALESCE(consignee_uncode)<>'' $sqlWhere group by consignee_uncode order by catnum desc limit 10";
|
|
|
|
|
|
|
+ consignee_uncode as station from online_ocean where 1=1 and COALESCE(consignee_uncode,'')<>'' $sqlWhere group by consignee_uncode order by catnum desc limit 10";
|
|
|
$co2e_aLL = common::excuteListSql($co2e_consignee_sql);
|
|
$co2e_aLL = common::excuteListSql($co2e_consignee_sql);
|
|
|
}
|
|
}
|
|
|
//最大Y值
|
|
//最大Y值
|
|
@@ -1278,7 +1305,7 @@ class common {
|
|
|
$toporiginType = "shippr_uncode";
|
|
$toporiginType = "shippr_uncode";
|
|
|
$shippr_uncode_10_sql ="with aa as (select count(shippr_uncode) as num,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 online_ocean
|
|
(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)
|
|
|
|
|
|
|
+ where 1=1 and COALESCE(shippr_uncode,'')<>'' $sqlWhere group by shippr_uncode order by num desc limit 10)
|
|
|
select aa.*,dd.* from aa
|
|
select aa.*,dd.* from aa
|
|
|
left join LATERAL ( select lon as lng, lat as lat,
|
|
left join LATERAL ( select lon as lng, lat as lat,
|
|
|
'' as label, '' as infor, 3 as sort,
|
|
'' as label, '' as infor, 3 as sort,
|
|
@@ -1289,7 +1316,7 @@ class common {
|
|
|
if(count($shippr_uncode_10) == 1 && empty($shippr_uncode_10[0]["shippr_uncode"])){
|
|
if(count($shippr_uncode_10) == 1 && empty($shippr_uncode_10[0]["shippr_uncode"])){
|
|
|
$toporiginType = "fport_of_loading_un";
|
|
$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
|
|
$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)
|
|
|
|
|
|
|
+ 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
|
|
select aa.*,dd.* from aa
|
|
|
left join LATERAL ( select lon as lng, lat as lat,
|
|
left join LATERAL ( select lon as lng, lat as lat,
|
|
|
'' as label, '' as infor, 3 as sort,
|
|
'' as label, '' as infor, 3 as sort,
|
|
@@ -1302,7 +1329,7 @@ class common {
|
|
|
$topdestinationinType = "consignee_uncode";
|
|
$topdestinationinType = "consignee_uncode";
|
|
|
$consignee_uncode_10_sql = "with aa as (select count(consignee_uncode) as num,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
|
|
(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)
|
|
|
|
|
|
|
+ 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
|
|
select aa.*,dd.* from aa
|
|
|
left join LATERAL ( select lon as lng, lat as lat,
|
|
left join LATERAL ( select lon as lng, lat as lat,
|
|
|
'' as label, '' as infor, 3 as sort,
|
|
'' as label, '' as infor, 3 as sort,
|
|
@@ -1313,7 +1340,7 @@ class common {
|
|
|
//如果值没有:客户地址-->站点地址-->Port地址(POL/POD)
|
|
//如果值没有:客户地址-->站点地址-->Port地址(POL/POD)
|
|
|
if(count($consignee_uncode_10) == 1 && empty($consignee_uncode_10[0]["consignee_uncode"])){
|
|
if(count($consignee_uncode_10) == 1 && empty($consignee_uncode_10[0]["consignee_uncode"])){
|
|
|
$topdestinationinType = "mport_of_discharge_un";
|
|
$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 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
|
|
select aa.*,dd.* from aa
|
|
|
left join LATERAL ( select lon as lng, lat as lat,
|
|
left join LATERAL ( select lon as lng, lat as lat,
|
|
|
'' as label, '' as infor, 3 as sort,
|
|
'' as label, '' as infor, 3 as sort,
|