|
|
@@ -93,9 +93,6 @@ class destination_delivery {
|
|
|
and coalesce(e.email,'') <>''
|
|
|
and e.email ilike '" . common::check_input($term) . "%' limit 20";
|
|
|
|
|
|
- // $sql = "select email from public.ra_online_user where user_type = 'Employee' and lower(contact_id) in ($more_param)
|
|
|
- // and email ilike '" . common::check_input($term) . "%' limit 20";
|
|
|
- //error_log($sql);
|
|
|
$rs = common::excuteListSql($sql);
|
|
|
$retData = array();
|
|
|
foreach($rs as $key => $val){
|
|
|
@@ -176,11 +173,11 @@ class destination_delivery {
|
|
|
$more_param_country = common::getInNotInSqlForSearch(utils::implode(';',$country));
|
|
|
|
|
|
$delivery_serial_no = common::deCode($_REQUEST['delivery_serial_no'], 'D');
|
|
|
- //$delivery_serial_no = 'c4d2951f438a4c9fccde37f26614740a';
|
|
|
+ //contact_person,contact_number, 现在系统还没有把这两个字段接入
|
|
|
if(!empty($delivery_serial_no)){
|
|
|
$sql = "SELECT addr1,addr2,addr3,addr4,
|
|
|
ctry_code,city_code,postal_code,
|
|
|
- contact_person,contact_number,
|
|
|
+ '' as contact_person,'' as contact_number,
|
|
|
create_user,contact_id,sync_key,
|
|
|
from_station,
|
|
|
'from Ksmart' as op_action
|
|
|
@@ -201,7 +198,7 @@ class destination_delivery {
|
|
|
}else{
|
|
|
$sql = "SELECT addr1,addr2,addr3,addr4,
|
|
|
ctry_code,city_code,postal_code,
|
|
|
- contact_person,contact_number,
|
|
|
+ '' as contact_person,'' as contact_number,
|
|
|
create_user,contact_id,sync_key,
|
|
|
from_station,
|
|
|
'from Ksmart' as op_action
|
|
|
@@ -426,7 +423,8 @@ class destination_delivery {
|
|
|
$booking_window_date_start = common::check_input($_POST['booking_window_date_start']);
|
|
|
$booking_window_date_end = common::check_input($_POST['booking_window_date_end']);
|
|
|
$recommended_delivery = common::check_input($_POST['recommended_delivery']);
|
|
|
- $kln_pic = common::check_input($_POST['kln_pic']);
|
|
|
+ $kln_pic = $_POST['kln_pic'];
|
|
|
+ $kln_pic = utils::implode(";",$kln_pic);
|
|
|
$booking_window_desc = common::check_input($_POST['booking_window_desc']);
|
|
|
$recommended_delivery_date_desc = common::check_input($_POST['recommended_delivery_date_desc']);
|
|
|
|
|
|
@@ -616,7 +614,7 @@ class destination_delivery {
|
|
|
$sqlDeliveryWhere = " 1=1";
|
|
|
if(_isApexLogin()){
|
|
|
//$sqlDeliveryWhere .= " and '".strtolower("CATHY.LEE@APEXSHIPPING.COM")."' = ANY(regexp_split_to_array(LOWER(kd.kln_pic), ','))";
|
|
|
- $sqlDeliveryWhere .= " and '".strtolower(_getLoginEmployeeEamil())."' = ANY(regexp_split_to_array(LOWER(kd.kln_pic), ','))";
|
|
|
+ //$sqlDeliveryWhere .= " and '".strtolower(_getLoginEmployeeEamil())."' = ANY(regexp_split_to_array(LOWER(kd.kln_pic), ','))";
|
|
|
}
|
|
|
|
|
|
//条件带入
|
|
|
@@ -717,6 +715,7 @@ class destination_delivery {
|
|
|
$rs[$key]["_serial_no"] = common::deCode($val['serial_no'], 'E');
|
|
|
$rs[$key]["status"] = common::deliveryStatusConvert($val['status']);
|
|
|
$rs[$key]["h_bol"] = json_decode($val['h_bol_multiple_link']);
|
|
|
+ $rs[$key]["kln_pic"] = empty($val['kln_pic']) ? array() : explode(";", $val['kln_pic']);
|
|
|
}
|
|
|
$arrTmp = array('searchData' => $rs,
|
|
|
'is_employee' => _isApexLogin(),
|
|
|
@@ -1193,10 +1192,6 @@ class destination_delivery {
|
|
|
//兜底规则
|
|
|
$sqlWhere = $sqlWhere_common;
|
|
|
$sqlWhere .= " and eta >= now() - INTERVAL '6 months' and eta <= now() + INTERVAL '6 months'";
|
|
|
- // $checkOpenSql = "with oo as ( select DISTINCT agent from public.kln_ocean oo ". $sqlWhere.")
|
|
|
- // select agent from oo
|
|
|
- // where exists(select 1 from public.kln_destination_delivery_config where oo.agent in (select regexp_split_to_table(station, E',')))
|
|
|
- // limit 1";
|
|
|
$checkOpenSql = "select station from public.kln_destination_delivery_config dc
|
|
|
where exists(select 1 from
|
|
|
public.kln_ocean oo ". $sqlWhere."
|