|
@@ -3571,7 +3571,7 @@ class common {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- public static function checkOverlap($post_arr,$name) {
|
|
|
|
|
|
|
+ public static function checkOverlap($post_arr,$name,$startIndex = 0) {
|
|
|
$errors = "";
|
|
$errors = "";
|
|
|
$num = count($post_arr);
|
|
$num = count($post_arr);
|
|
|
//$_POST['rule_type'];
|
|
//$_POST['rule_type'];
|
|
@@ -3580,12 +3580,12 @@ class common {
|
|
|
$set1 = $post_arr[$i] ?? [];
|
|
$set1 = $post_arr[$i] ?? [];
|
|
|
$set2 = $post_arr[$j] ?? [];
|
|
$set2 = $post_arr[$j] ?? [];
|
|
|
|
|
|
|
|
- $intersection = common::array_intersect_own($set1, $set2,$_POST['rule_type'][$i]);
|
|
|
|
|
|
|
+ $intersection = common::array_intersect_own($set1, $set2,$_POST['rule_type'][$i+$startIndex]);
|
|
|
$intersectionC = "";
|
|
$intersectionC = "";
|
|
|
//这个特殊。如果ports 存在一样的,那检查carrier 是否存在一样的。
|
|
//这个特殊。如果ports 存在一样的,那检查carrier 是否存在一样的。
|
|
|
if ($name == "Sea Rule") {
|
|
if ($name == "Sea Rule") {
|
|
|
- $setC1 = explode(",",$_POST['carrier'][$i]) ?? [];
|
|
|
|
|
- $setC2 = explode(",",$_POST['carrier'][$j]) ?? [];
|
|
|
|
|
|
|
+ $setC1 = explode(",",$_POST['carrier'][$i+$startIndex]) ?? [];
|
|
|
|
|
+ $setC2 = explode(",",$_POST['carrier'][$j+$startIndex]) ?? [];
|
|
|
|
|
|
|
|
$intersectionC = array_intersect($setC1, $setC2);
|
|
$intersectionC = array_intersect($setC1, $setC2);
|
|
|
if (!empty($intersection) && !empty($intersectionC)) {
|
|
if (!empty($intersection) && !empty($intersectionC)) {
|
|
@@ -3610,16 +3610,19 @@ class common {
|
|
|
return $errors;
|
|
return $errors;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- public static function array_intersect_own($set1, $set2,$rule_type){
|
|
|
|
|
|
|
+ public static function array_intersect_own($set1, $set2){
|
|
|
$intersection = array_intersect($set1, $set2);
|
|
$intersection = array_intersect($set1, $set2);
|
|
|
- if ($rule_type <> '*Default Rule' && ($set1 == 'ALL' || $set2 == 'ALL')){
|
|
|
|
|
- $intersection = "ALL";
|
|
|
|
|
- }
|
|
|
|
|
|
|
+
|
|
|
|
|
+ //这个是无效的$set1是数组,不是字符串。
|
|
|
|
|
+ // if ($rule_type <> '*Default Rule' && ($set1 == 'ALL' || $set2 == 'ALL')){
|
|
|
|
|
+ // $intersection = "ALL";
|
|
|
|
|
+ // }
|
|
|
return $intersection;
|
|
return $intersection;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public static function sendDestinationDeliveryReminder($data,$shipmentsData,$status){
|
|
public static function sendDestinationDeliveryReminder($data,$shipmentsData,$status){
|
|
|
$html_tr = "";
|
|
$html_tr = "";
|
|
|
|
|
+ $dest_op_arr = array();
|
|
|
foreach($shipmentsData['data'] as $shipment){
|
|
foreach($shipmentsData['data'] as $shipment){
|
|
|
$html_tr .="<tr style=\"color: #ED6D00;\">
|
|
$html_tr .="<tr style=\"color: #ED6D00;\">
|
|
|
<td align=\"center\" style=\" width: 162px;padding: 10px;word-wrap: break-word; word-break: break-all; white-space: normal;\">".$shipment['h_bol']."</td>
|
|
<td align=\"center\" style=\" width: 162px;padding: 10px;word-wrap: break-word; word-break: break-all; white-space: normal;\">".$shipment['h_bol']."</td>
|
|
@@ -3627,6 +3630,9 @@ class common {
|
|
|
<td align=\"center\" style=\" width: 162px;padding: 10px;word-wrap: break-word; word-break: break-all; white-space: normal;\">".$shipment['package_type']."</td>
|
|
<td align=\"center\" style=\" width: 162px;padding: 10px;word-wrap: break-word; word-break: break-all; white-space: normal;\">".$shipment['package_type']."</td>
|
|
|
<td align=\"center\" style=\" width: 162px;padding: 10px;word-wrap: break-word; word-break: break-all; white-space: normal;\">".$shipment['kgw']."</td>
|
|
<td align=\"center\" style=\" width: 162px;padding: 10px;word-wrap: break-word; word-break: break-all; white-space: normal;\">".$shipment['kgw']."</td>
|
|
|
</tr>";
|
|
</tr>";
|
|
|
|
|
+ if(!empty($shipment['dest_op'])){
|
|
|
|
|
+ $dest_op_arr[] = $shipment['dest_op'];
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
$kln_pic_email = $data['kln_pic'];
|
|
$kln_pic_email = $data['kln_pic'];
|
|
@@ -3676,6 +3682,14 @@ class common {
|
|
|
$email_from = "US.KApex.Online@kerryapex.com";
|
|
$email_from = "US.KApex.Online@kerryapex.com";
|
|
|
$to_email = $customer_email;
|
|
$to_email = $customer_email;
|
|
|
$cc_email = $kln_pic_email;
|
|
$cc_email = $kln_pic_email;
|
|
|
|
|
+ if(!empty($dest_op_arr)){
|
|
|
|
|
+ $dest_op_arr = array_values(array_unique($dest_op_arr));
|
|
|
|
|
+ $more_param = common::getInNotInSqlForSearch(strtolower(utils::implode(';',$dest_op_arr)));
|
|
|
|
|
+ $destOPEmail = common::excuteObjectSql("select string_agg(email,';') as email from employee where COALESCE(email,'') <> '' and lower(employee_id) in (".$more_param.")");
|
|
|
|
|
+ if(!empty($destOPEmail['email'])){
|
|
|
|
|
+ $cc_email = $cc_email.";".$destOPEmail['email'];
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
error_log($contents['content']);
|
|
error_log($contents['content']);
|
|
|
|
|
|