|
@@ -299,12 +299,12 @@ class destination_delivery {
|
|
|
|
|
|
|
|
$sqlWhere = ' where ' . common::searchExtendHand_KLN("ocean", $_SESSION["ONLINE_USER"]);
|
|
$sqlWhere = ' where ' . common::searchExtendHand_KLN("ocean", $_SESSION["ONLINE_USER"]);
|
|
|
//兜底规则
|
|
//兜底规则
|
|
|
- //$sqlWhere .= " and eta >= now() - INTERVAL '3 months' and eta <= now() + INTERVAL '1 months'";
|
|
|
|
|
- $consignee = common::check_input($_POST ['consignee']);
|
|
|
|
|
|
|
+ $sqlKNDDWhere = "and exists(select 1 from public.kln_ocean ". $sqlWhere." and kln_ocean.serial_no = any(kln_destination_delivery.h_serial_no) limit 1)";
|
|
|
|
|
+
|
|
|
|
|
+ $consignee = common::check_input($_POST ['consignee']);
|
|
|
if(!empty($consignee)){
|
|
if(!empty($consignee)){
|
|
|
- $sqlWhere .= " and consignee ilike '".$consignee."%'";
|
|
|
|
|
- }
|
|
|
|
|
- $sqlKNDDWhere = "and exists(select 1 from public.kln_ocean ". $sqlWhere." and kln_ocean.serial_no = any(kln_destination_delivery.h_serial_no) limit 1)";
|
|
|
|
|
|
|
+ $sqlKNDDWhere .= " and consignee ilike '%".$consignee."%'";
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
$sql = "select DISTINCT consignee AS code from public.kln_destination_delivery
|
|
$sql = "select DISTINCT consignee AS code from public.kln_destination_delivery
|
|
|
where
|
|
where
|
|
@@ -807,6 +807,9 @@ class destination_delivery {
|
|
|
|
|
|
|
|
$sqlWhere_bk= $sqlWhere;
|
|
$sqlWhere_bk= $sqlWhere;
|
|
|
$sqlKNDDWhere = "and exists(select 1 from public.kln_ocean ". $sqlWhere_bk." and kln_ocean.serial_no = any(kln_destination_delivery.h_serial_no) limit 1)";
|
|
$sqlKNDDWhere = "and exists(select 1 from public.kln_ocean ". $sqlWhere_bk." and kln_ocean.serial_no = any(kln_destination_delivery.h_serial_no) limit 1)";
|
|
|
|
|
+ if(!empty($consignee)){
|
|
|
|
|
+ $sqlKNDDWhere .= " and consignee ilike '%".$consignee."%'";
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
//兜底规则
|
|
//兜底规则
|
|
|
$sqlWhere .= " and eta >= now() - INTERVAL '3 months' and eta <= now() + INTERVAL '1 months' and 1<>1 ";
|
|
$sqlWhere .= " and eta >= now() - INTERVAL '3 months' and eta <= now() + INTERVAL '1 months' and 1<>1 ";
|