|
@@ -557,46 +557,33 @@ class ajax {
|
|
|
}
|
|
}
|
|
|
if($search_field == "Origin" && $search_mode == "tracking"){
|
|
if($search_field == "Origin" && $search_mode == "tracking"){
|
|
|
$sqlWhere = $this->getTrackingSearchWhere();
|
|
$sqlWhere = $this->getTrackingSearchWhere();
|
|
|
-
|
|
|
|
|
- $count_sql = "select COUNT(DISTINCT city) from (select left(shippr_uncode, 2) as country,shipper_city as city, shippr_uncode as uncode
|
|
|
|
|
- from public.online_ocean $sqlWhere
|
|
|
|
|
- and COALESCE(shippr_uncode)<>''
|
|
|
|
|
- and (shipper_city ilike '%" . common::check_input($term) . "%'
|
|
|
|
|
- or shippr_uncode ilike '%" . common::check_input($term) . "%')
|
|
|
|
|
- union
|
|
|
|
|
- select left(consignee_uncode, 2) as country,consignee_city as city, consignee_uncode as uncode
|
|
|
|
|
|
|
+ $count_sql = "select COUNT(DISTINCT shipper_city)
|
|
|
from public.online_ocean $sqlWhere
|
|
from public.online_ocean $sqlWhere
|
|
|
- and COALESCE(consignee_uncode)<>''
|
|
|
|
|
- and (consignee_city ilike '%" . common::check_input($term) . "%'
|
|
|
|
|
- or consignee_uncode ilike '%" . common::check_input($term) . "%')) as temp";
|
|
|
|
|
|
|
+ and COALESCE(shippr_uncode)<>''
|
|
|
|
|
+ and (shipper_city ilike '%" . common::check_input($term) . "%'
|
|
|
|
|
+ or shippr_uncode ilike '%" . common::check_input($term) . "%')";
|
|
|
|
|
|
|
|
- $sql = "select country, city,uncode from(select left(shippr_uncode, 2) as country,shipper_city as city, shippr_uncode as uncode,etd,eta
|
|
|
|
|
|
|
+ $sql = "select left(shippr_uncode, 2) as country,shipper_city as city, shippr_uncode as uncode
|
|
|
from public.online_ocean $sqlWhere
|
|
from public.online_ocean $sqlWhere
|
|
|
and COALESCE(shippr_uncode)<>''
|
|
and COALESCE(shippr_uncode)<>''
|
|
|
and (shipper_city ilike '%" . common::check_input($term) . "%'
|
|
and (shipper_city ilike '%" . common::check_input($term) . "%'
|
|
|
- or shippr_uncode ilike '%" . common::check_input($term) . "%')
|
|
|
|
|
- union
|
|
|
|
|
- select left(consignee_uncode, 2) as country,consignee_city as city, consignee_uncode as uncode,etd,eta
|
|
|
|
|
- from public.online_ocean $sqlWhere
|
|
|
|
|
- and COALESCE(consignee_uncode)<>''
|
|
|
|
|
- and (consignee_city ilike '%" . common::check_input($term) . "%'
|
|
|
|
|
- or consignee_uncode ilike '%" . common::check_input($term) . "%')) as temp order by $order_by";
|
|
|
|
|
- return array("count_sql"=>$count_sql,"sql"=>$sql);
|
|
|
|
|
|
|
+ or shippr_uncode ilike '%" . common::check_input($term) . "%') order by $order_by";
|
|
|
|
|
+ return array("count_sql"=>$count_sql,"sql"=>$sql);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
if($search_field == "Destination" && $search_mode == "tracking"){
|
|
if($search_field == "Destination" && $search_mode == "tracking"){
|
|
|
$sqlWhere = $this->getTrackingSearchWhere();
|
|
$sqlWhere = $this->getTrackingSearchWhere();
|
|
|
- $count_sql = "select COUNT(DISTINCT final_desination_exp)
|
|
|
|
|
|
|
+ $count_sql = "select COUNT(DISTINCT consignee_city)
|
|
|
from public.online_ocean $sqlWhere
|
|
from public.online_ocean $sqlWhere
|
|
|
- and COALESCE(final_desination_uncode)<>''
|
|
|
|
|
- and (final_desination_exp ilike '%" . common::check_input($term) . "%'
|
|
|
|
|
- or final_desination_uncode ilike '%" . common::check_input($term) . "%')";
|
|
|
|
|
|
|
+ and COALESCE(consignee_uncode)<>''
|
|
|
|
|
+ and (consignee_city ilike '%" . common::check_input($term) . "%'
|
|
|
|
|
+ or consignee_uncode ilike '%" . common::check_input($term) . "%')";
|
|
|
|
|
|
|
|
- $sql = "select left(final_desination_uncode, 2) as country,final_desination_exp as city, final_desination_uncode as uncode
|
|
|
|
|
|
|
+ $sql = "select left(consignee_uncode, 2) as country,consignee_city as city, consignee_uncode as uncode
|
|
|
from public.online_ocean $sqlWhere
|
|
from public.online_ocean $sqlWhere
|
|
|
- and COALESCE(final_desination_uncode)<>''
|
|
|
|
|
- and (final_desination_exp ilike '%" . common::check_input($term) . "%'
|
|
|
|
|
- or final_desination_uncode ilike '%" . common::check_input($term) . "%') order by $order_by";
|
|
|
|
|
|
|
+ and COALESCE(consignee_uncode)<>''
|
|
|
|
|
+ and (consignee_city ilike '%" . common::check_input($term) . "%'
|
|
|
|
|
+ or consignee_uncode ilike '%" . common::check_input($term) . "%') order by $order_by";
|
|
|
return array("count_sql"=>$count_sql,"sql"=>$sql);
|
|
return array("count_sql"=>$count_sql,"sql"=>$sql);
|
|
|
}
|
|
}
|
|
|
|
|
|