|
@@ -602,19 +602,12 @@ class common {
|
|
|
} else {
|
|
} else {
|
|
|
//employee_search_type 的设置
|
|
//employee_search_type 的设置
|
|
|
$sqlStr = _employeeFilerSearch('ocean','employee_contact_id_user','employee_company_name',$schemas);
|
|
$sqlStr = _employeeFilerSearch('ocean','employee_contact_id_user','employee_company_name',$schemas);
|
|
|
- if( $sqlStr != "1<>1"){
|
|
|
|
|
- $sqlWhere .= " and " .$sqlStr;
|
|
|
|
|
- }
|
|
|
|
|
|
|
|
|
|
if (empty($o) && empty($d) && empty($sales) && empty($op) && empty($follow)&& $sqlStr == "1<>1") {
|
|
if (empty($o) && empty($d) && empty($sales) && empty($op) && empty($follow)&& $sqlStr == "1<>1") {
|
|
|
return " and 1<>1";
|
|
return " and 1<>1";
|
|
|
}
|
|
}
|
|
|
if (strtolower($o_or) == "all" || strtolower($d_or) == "all" || strtolower($sales_or) == "all" || strtolower($op_or) == "all") {
|
|
if (strtolower($o_or) == "all" || strtolower($d_or) == "all" || strtolower($sales_or) == "all" || strtolower($op_or) == "all") {
|
|
|
- if( $sqlStr != "1<>1"){
|
|
|
|
|
- return " and 1=1 and " .$sqlStr;
|
|
|
|
|
- }else{
|
|
|
|
|
- return " and 1=1";
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ return " and 1=1";
|
|
|
}
|
|
}
|
|
|
if ((strtolower($o) == 'all' || empty($o)) && (strtolower($d) == "all" || empty($d))) {
|
|
if ((strtolower($o) == 'all' || empty($o)) && (strtolower($d) == "all" || empty($d))) {
|
|
|
|
|
|
|
@@ -706,6 +699,9 @@ class common {
|
|
|
$sqlWhere .= " or following_sales ilike '" . $follow_or . "'";
|
|
$sqlWhere .= " or following_sales ilike '" . $follow_or . "'";
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+ if( $sqlStr != "1<>1"){
|
|
|
|
|
+ $sqlWhere .= " or " .$sqlStr;
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
$sqlWhere = " and ($sqlWhere)";
|
|
$sqlWhere = " and ($sqlWhere)";
|
|
|
}
|
|
}
|
|
@@ -734,18 +730,12 @@ class common {
|
|
|
} else {
|
|
} else {
|
|
|
//employee_search_type 的设置
|
|
//employee_search_type 的设置
|
|
|
$sqlStr = _employeeFilerSearch('ocean','employee_contact_id_user','employee_company_name',$schames);
|
|
$sqlStr = _employeeFilerSearch('ocean','employee_contact_id_user','employee_company_name',$schames);
|
|
|
- if( $sqlStr != "1<>1"){
|
|
|
|
|
- $sqlWhere .= " and " .$sqlStr;
|
|
|
|
|
- }
|
|
|
|
|
|
|
+
|
|
|
if (empty($o) && empty($d) && empty($sales) && empty($op) && empty($follow)&& $sqlStr == "1<>1") {
|
|
if (empty($o) && empty($d) && empty($sales) && empty($op) && empty($follow)&& $sqlStr == "1<>1") {
|
|
|
return " and 1<>1";
|
|
return " and 1<>1";
|
|
|
}
|
|
}
|
|
|
if (strtolower($o_or) == "all" || strtolower($d_or) == "all" || strtolower($sales_or) == "all") {
|
|
if (strtolower($o_or) == "all" || strtolower($d_or) == "all" || strtolower($sales_or) == "all") {
|
|
|
- if( $sqlStr != "1<>1"){
|
|
|
|
|
- return " and 1=1 and " .$sqlStr;
|
|
|
|
|
- }else{
|
|
|
|
|
- return " and 1=1";
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ return " and 1=1";
|
|
|
}
|
|
}
|
|
|
if ((strtolower($o) == 'all' || empty($o)) && (strtolower($d) == "all" || empty($d))) {
|
|
if ((strtolower($o) == 'all' || empty($o)) && (strtolower($d) == "all" || empty($d))) {
|
|
|
|
|
|
|
@@ -827,6 +817,9 @@ class common {
|
|
|
} else
|
|
} else
|
|
|
$sqlWhere .= " or following_sales ilike '" . $follow_or . "%'";
|
|
$sqlWhere .= " or following_sales ilike '" . $follow_or . "%'";
|
|
|
}
|
|
}
|
|
|
|
|
+ if( $sqlStr != "1<>1"){
|
|
|
|
|
+ $sqlWhere .= " or " .$sqlStr;
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
$sqlWhere = " and ($sqlWhere)";
|
|
$sqlWhere = " and ($sqlWhere)";
|
|
|
}
|
|
}
|
|
@@ -848,9 +841,6 @@ class common {
|
|
|
} else {
|
|
} else {
|
|
|
//employee_search_type 的设置
|
|
//employee_search_type 的设置
|
|
|
$sqlStr = _employeeFilerSearch('air','employee_air_contact_id_user','employee_air_company_name',$schemas);
|
|
$sqlStr = _employeeFilerSearch('air','employee_air_contact_id_user','employee_air_company_name',$schemas);
|
|
|
- if( $sqlStr != "1<>1"){
|
|
|
|
|
- $sqlWhere .= " and " .$sqlStr;
|
|
|
|
|
- }
|
|
|
|
|
|
|
|
|
|
if (empty($station) && empty($sales) && $sqlStr == "1<>1") {
|
|
if (empty($station) && empty($sales) && $sqlStr == "1<>1") {
|
|
|
return "and 1<>1";
|
|
return "and 1<>1";
|
|
@@ -877,6 +867,9 @@ class common {
|
|
|
$sqlWhere = "$sqlWhere or lower(origin)" . utils::getInSql($station_or) . " or lower(agent)" . utils::getInSql($station_or);
|
|
$sqlWhere = "$sqlWhere or lower(origin)" . utils::getInSql($station_or) . " or lower(agent)" . utils::getInSql($station_or);
|
|
|
if (!empty($sales_or))
|
|
if (!empty($sales_or))
|
|
|
$sqlWhere = "$sqlWhere or lower(sales_rep)" . utils::getInSql($sales_or) . " or lower(following_sales)" . utils::getInSql($sales_or);
|
|
$sqlWhere = "$sqlWhere or lower(sales_rep)" . utils::getInSql($sales_or) . " or lower(following_sales)" . utils::getInSql($sales_or);
|
|
|
|
|
+ if( $sqlStr != "1<>1"){
|
|
|
|
|
+ $sqlWhere = $sqlWhere. " or " .$sqlStr;
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
return " and ($sqlWhere)";
|
|
return " and ($sqlWhere)";
|
|
|
}
|
|
}
|
|
@@ -5003,19 +4996,19 @@ class common {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
$joinPublic = "
|
|
$joinPublic = "
|
|
|
- LEFT JOIN public.oc_container oc ON oo.serial_no::text = oc.serial_no::text AND oo.order_from = 'public'";
|
|
|
|
|
|
|
+ INNER JOIN public.oc_container oc ON oo.serial_no::text = oc.serial_no::text AND oo.order_from = 'public'";
|
|
|
|
|
|
|
|
$joinSfs = "
|
|
$joinSfs = "
|
|
|
- LEFT JOIN sfs.oc_container oc ON oo.serial_no::text = oc.serial_no::text AND oo.order_from = 'sfs'";
|
|
|
|
|
|
|
+ INNER JOIN sfs.oc_container oc ON oo.serial_no::text = oc.serial_no::text AND oo.order_from = 'sfs'";
|
|
|
|
|
|
|
|
// 公共部分:JOIN 容器和 item
|
|
// 公共部分:JOIN 容器和 item
|
|
|
if ($needContainerData && $needItemData) {
|
|
if ($needContainerData && $needItemData) {
|
|
|
$joinPublic = "
|
|
$joinPublic = "
|
|
|
- LEFT JOIN public.oc_container oc ON oo.serial_no::text = oc.serial_no::text AND oo.order_from = 'public'
|
|
|
|
|
|
|
+ INNER JOIN public.oc_container oc ON oo.serial_no::text = oc.serial_no::text AND oo.order_from = 'public'
|
|
|
LEFT JOIN public.oc_container_item oi ON oc.id = oi.oc_container_id";
|
|
LEFT JOIN public.oc_container_item oi ON oc.id = oi.oc_container_id";
|
|
|
|
|
|
|
|
$joinSfs = "
|
|
$joinSfs = "
|
|
|
- LEFT JOIN sfs.oc_container oc ON oo.serial_no::text = oc.serial_no::text AND oo.order_from = 'sfs'
|
|
|
|
|
|
|
+ INNER JOIN sfs.oc_container oc ON oo.serial_no::text = oc.serial_no::text AND oo.order_from = 'sfs'
|
|
|
LEFT JOIN sfs.oc_container_item oi ON oc.id = oi.oc_container_id";
|
|
LEFT JOIN sfs.oc_container_item oi ON oc.id = oi.oc_container_id";
|
|
|
}
|
|
}
|
|
|
|
|
|