|
|
@@ -346,7 +346,7 @@ class tools {
|
|
|
'tp' => intval($tp)
|
|
|
);
|
|
|
} else {
|
|
|
- $arrTmp = array('searchData' => array(),
|
|
|
+ $arrTmp = array('monitoringRules' => array(),
|
|
|
'rc' => intval($rc),
|
|
|
'ps' => intval($ps),
|
|
|
'cp' => intval($cp),
|
|
|
@@ -427,13 +427,15 @@ class tools {
|
|
|
$delayData = array();
|
|
|
$changeData = array();
|
|
|
if ($rules_type == "all"){
|
|
|
- $rules_type = "Milestone_Update;Container_Status_Update;Departure/Arrival_Delay;ETD/ETA_Change";
|
|
|
+ $rules_type = "Milestone_Update;Container_Status_Update;Departure/Arrival_Delay;ETD/ETA_Change;Feature_Update;Passwond_Notifcations";
|
|
|
$allData = $this->getNotifications($rules_type,"all");
|
|
|
|
|
|
$milestoneData = $allData['Milestone_Update'];
|
|
|
$containerData = $allData['Container_Status_Update'];
|
|
|
$delayData = $allData['Departure/Arrival_Delay'];
|
|
|
$changeData = $allData['ETD/ETA_Change'];
|
|
|
+ $featureUpdate = $allData['Feature_Update'];
|
|
|
+ $passwond_Notifcations = $allData['Passwond_Notifcations'];
|
|
|
} else {
|
|
|
$data = $this->getNotifications($rules_type,"all");
|
|
|
if($rules_type == "Milestone_Update"){
|
|
|
@@ -444,10 +446,15 @@ class tools {
|
|
|
$delayData = $data['Departure/Arrival_Delay'];
|
|
|
}elseif($rules_type == "ETD/ETA_Change"){
|
|
|
$changeData = $data['ETD/ETA_Change'];
|
|
|
+ }elseif($rules_type == "Feature_Update"){
|
|
|
+ $featureUpdate = $data['Feature_Update'];
|
|
|
+ }elseif($rules_type == "Passwond_Notifcations"){
|
|
|
+ $passwond_Notifcations = $data['Passwond_Notifcations'];
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- $data = array("milestoneData"=>$milestoneData,"containerData"=>$containerData,"delayData"=>$delayData,"changeData"=>$changeData);
|
|
|
+ $data = array("milestoneData"=>$milestoneData,"containerData"=>$containerData,"delayData"=>$delayData,
|
|
|
+ "changeData"=>$changeData,"featureUpdate"=>$featureUpdate,"passwond_Notifcations"=>$passwond_Notifcations);
|
|
|
$instant_sum = array();
|
|
|
foreach($data as $v){
|
|
|
if(!empty($v['instant'])){
|
|
|
@@ -473,12 +480,18 @@ class tools {
|
|
|
}
|
|
|
//根据时间顺序排序
|
|
|
$insert_dates = array_column($instant_sum, 'insert_date');
|
|
|
- array_multisort($insert_dates, SORT_ASC, $instant_sum);
|
|
|
+ array_multisort($insert_dates, SORT_DESC, $instant_sum);
|
|
|
|
|
|
$info = array();
|
|
|
foreach($instant_sum as $mInfo){
|
|
|
$eventCard = $this->getEventCard($mInfo);
|
|
|
- $info[] = array("notificationType"=>"event","info" =>$eventCard);
|
|
|
+ if(!empty($mInfo['other_type']) && $mInfo['other_type'] == "password"){
|
|
|
+ $info[] = array("notificationType"=>"password","info" =>$eventCard);
|
|
|
+ }elseif(!empty($mInfo['other_type']) && $mInfo['other_type'] == "feature"){
|
|
|
+ $info[] = array("notificationType"=>"feature","info" =>$eventCard);
|
|
|
+ }else{
|
|
|
+ $info[] = array("notificationType"=>"event","info" =>$eventCard);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
$returnData = $info;
|
|
|
@@ -507,8 +520,9 @@ class tools {
|
|
|
if($key == 0){
|
|
|
$returnData["title"] = $eventCard["title"];
|
|
|
if($eventCard["type"] == "change" || $eventCard["type"] == "delay"){
|
|
|
- $returnData["numericRecords_one"] = $dataInfo["numericRecords_one"];
|
|
|
- $returnData["numericRecords_two"] =$dataInfo["numericRecords_two"];
|
|
|
+ $returnData["etdOrdeparturNum"] = $dataInfo["numericRecords_one"];
|
|
|
+ $returnData["etaOrarrivalNum"] =$dataInfo["numericRecords_two"];
|
|
|
+ $returnData["type"] =$eventCard["type"];
|
|
|
}else{
|
|
|
$returnData["numericRecords"] = $dataInfo["numericRecords"];
|
|
|
}
|
|
|
@@ -525,8 +539,8 @@ class tools {
|
|
|
//点击seall会默认全部标记为已读
|
|
|
if(!empty($ids)){
|
|
|
$more_param = common::getInNotInSqlForSearch(strtolower(utils::implode(';',$ids)));
|
|
|
- $markReadSql = "update public.kln_notifiation_info set is_send_message = true where id in ($more_param)";
|
|
|
- //common::excuteUpdateSql($markReadSql);
|
|
|
+ $markReadSql = "update public.kln_notifiation_info set is_send_message = true,readed_date = now() where id in ($more_param)";
|
|
|
+ common::excuteUpdateSql($markReadSql);
|
|
|
}
|
|
|
common::echo_json_encode(200,$returnData);
|
|
|
exit();
|
|
|
@@ -537,10 +551,10 @@ class tools {
|
|
|
$id = $_POST["id"];
|
|
|
//代表改用户下的所有信息全部标记为已读
|
|
|
if ($read_type == "true"){
|
|
|
- $rs = common::excuteUpdateSql("update public.kln_notifiation_info set is_send_message = true where lower(user_login) = '".strtolower(_getLoginName())."'");
|
|
|
+ $rs = common::excuteUpdateSql("update public.kln_notifiation_info set is_send_message = true,readed_date = now() where lower(user_login) = '".strtolower(_getLoginName())."'");
|
|
|
}else{
|
|
|
$more_param = common::getInNotInSqlForSearch(strtolower(utils::implode(';',$id)));
|
|
|
- $markReadSql = "update public.kln_notifiation_info set is_send_message = true where id in ($more_param)";
|
|
|
+ $markReadSql = "update public.kln_notifiation_info set is_send_message = true,readed_date = now() where id in ($more_param)";
|
|
|
$rs = common::excuteUpdateSql($markReadSql);
|
|
|
}
|
|
|
if ($rs === FALSE){
|
|
|
@@ -554,24 +568,126 @@ class tools {
|
|
|
}
|
|
|
|
|
|
if ($operate == "notifications_message_init"){
|
|
|
- $rules_type = common::check_input($_REQUEST['rules_type']);
|
|
|
//查询所有情况得未读情况 查询最近一年的情况
|
|
|
- "with dt as(select from public.kln_notifiation_info
|
|
|
- where insert_date > NOW() - INTERVAL '1 year'
|
|
|
- and notifications_method = 'true' and is_send_message = 'false'
|
|
|
+ $unreadSql = "with countTbale as (
|
|
|
+ select ni.notifiation_type,
|
|
|
+ case when COALESCE(ni.frequency_type,'') = 'Daily'
|
|
|
+ then to_char(timezone(ni.daily_time_zone, ni.insert_date),'Mon DD, YYYY')
|
|
|
+ when COALESCE(ni.frequency_type,'') = 'Weekly'
|
|
|
+ then to_char(date_trunc('week', ni.insert_date),'Mon DD, YYYY')|| ' - ' ||to_char((date_trunc('week', ni.insert_date) + INTERVAL '6 days'),'Mon DD, YYYY')
|
|
|
+ else ''
|
|
|
+ end as insert_date_format
|
|
|
+ from public.kln_notifiation_info ni
|
|
|
+ where ni.insert_date > NOW() - INTERVAL '1 year'
|
|
|
+ and ni.notifications_method = 'true' and ni.is_send_message = 'false'
|
|
|
and lower(ni.user_login) = '".strtolower(_getLoginName())."'
|
|
|
- and frequency_type = 'Daily' group by to_char(timezone(ni.daily_time_zone, ni.insert_date),'Mon DD, YYYY'))";
|
|
|
- "select
|
|
|
- sum(case when (1<>1 or (notifiation_type='Milestone_Update') then 1 else 0 end) as m_rc,
|
|
|
+ and ni.frequency_type in ('Daily','Weekly') group by ni.notifiation_type,insert_date_format
|
|
|
+ union all
|
|
|
+ select ni.notifiation_type, '' as insert_date_format
|
|
|
+ from public.kln_notifiation_info ni
|
|
|
+ where ni.insert_date > NOW() - INTERVAL '1 year'
|
|
|
+ and lower(ni.user_login) in ('".strtolower(_getLoginName())."','all_user')
|
|
|
+ and ni.notifications_method = 'true' and ni.is_send_message = 'false'
|
|
|
+ and frequency_type = 'Instant'
|
|
|
+ )
|
|
|
+ select
|
|
|
+ sum(case when (1<>1 or (notifiation_type='Milestone_Update')) then 1 else 0 end) as m_rc,
|
|
|
sum(case when (1<>1 or (notifiation_type='Container_Status_Update')) then 1 else 0 end) as cs_rc,
|
|
|
sum(case when (1<>1 or (notifiation_type='Departure/Arrival_Delay')) then 1 else 0 end) as da_rc,
|
|
|
sum(case when (1<>1 or (notifiation_type='ETD/ETA_Change')) then 1 else 0 end) as ec_rc,
|
|
|
- sum(case when (1<>1 or (notifiation_type='Feature_Update')) then 1 else 0 end) as f_rc,
|
|
|
- from public.kln_notifiation_info
|
|
|
- where insert_date > NOW() - INTERVAL '1 year'
|
|
|
- and frequency_type = 'Instant'
|
|
|
- and notifications_method = 'true' and is_send_message = 'false'
|
|
|
- and lower(ni.user_login) = '".strtolower(_getLoginName())."'";
|
|
|
+ sum(case when (1<>1 or (notifiation_type='Feature_Update')) then 1 else 0 end) as f_rc
|
|
|
+ from countTbale ";
|
|
|
+
|
|
|
+ $count = common::excuteObjectSql($unreadSql);
|
|
|
+
|
|
|
+ //单独的选中的数据
|
|
|
+ $rules_type = common::check_input($_REQUEST['rules_type']);
|
|
|
+ $data = $this->getNotifications($rules_type,"all");
|
|
|
+
|
|
|
+ $unreadCount = 0;
|
|
|
+ $readCount = 0;
|
|
|
+ $instant_sum = array();
|
|
|
+ if(!empty($data[$rules_type]['instant'])){
|
|
|
+ foreach($data[$rules_type]['instant'] as $instant){
|
|
|
+ $instant_sum[] = $instant;
|
|
|
+ if($instant["is_send_message"] == 't'){
|
|
|
+ $readCount +=1;
|
|
|
+ }else{
|
|
|
+ $unreadCount +=1;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(!empty($data[$rules_type]['daily'])){
|
|
|
+ $dailys = common::handleDailyWeekedData($data[$rules_type]['daily']);
|
|
|
+ foreach($dailys as $dailyArr){
|
|
|
+ //取第一组的第一个显示
|
|
|
+ $dailyFristAndFrist = utils::getDailyAndweeklyFrist($dailyArr);
|
|
|
+ $instant_sum[]= $dailyFristAndFrist;
|
|
|
+ if($dailyFristAndFrist["is_send_message"] == 't'){
|
|
|
+ $readCount +=1;
|
|
|
+ }else{
|
|
|
+ $unreadCount +=1;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(!empty($data[$rules_type]['weekly'])){
|
|
|
+ $weeklys = common::handleDailyWeekedData($data[$rules_type]['weekly']);
|
|
|
+ foreach($weeklys as $weeklyArr){
|
|
|
+ $weeklyFristAndFrist = utils::getDailyAndweeklyFrist($weeklyArr);
|
|
|
+ $instant_sum[]= $weeklyFristAndFrist;
|
|
|
+ if($weeklyFristAndFrist["is_send_message"] == 't'){
|
|
|
+ $readCount +=1;
|
|
|
+ }else{
|
|
|
+ $unreadCount +=1;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ //根据时间顺序排序
|
|
|
+ $insert_dates = array_column($instant_sum, 'insert_date');
|
|
|
+ array_multisort($insert_dates, SORT_DESC, $instant_sum);
|
|
|
+
|
|
|
+ $info = array();
|
|
|
+ foreach($instant_sum as $mInfo){
|
|
|
+ $eventCard = $this->getEventCard($mInfo);
|
|
|
+ if(!empty($mInfo['other_type']) && $mInfo['other_type'] == "password"){
|
|
|
+ $info[] = array("notificationType"=>"password","info" =>$eventCard);
|
|
|
+ }elseif(!empty($mInfo['other_type']) && $mInfo['other_type'] == "feature"){
|
|
|
+ $info[] = array("notificationType"=>"feature","info" =>$eventCard);
|
|
|
+ }else{
|
|
|
+ $info[] = array("notificationType"=>"event","info" =>$eventCard);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ //返回数据结构
|
|
|
+ $returnData = array();
|
|
|
+ $m_rc = empty($count['m_rc']) ? 0 : intval($count['m_rc']);
|
|
|
+ $cs_rc = empty($count['cs_rc']) ? 0 : intval($count['cs_rc']);
|
|
|
+ $da_rc = empty($count['da_rc']) ? 0 : intval($count['da_rc']);
|
|
|
+ $ec_rc = empty($count['ec_rc']) ? 0 : intval($count['ec_rc']);
|
|
|
+ $f_rc = empty($count['f_rc']) ? 0 : intval($count['f_rc']);
|
|
|
+ $returnData['countList'] = array($m_rc,$cs_rc,$da_rc,$ec_rc,$f_rc);
|
|
|
+ $returnData['allCount'] =count($instant_sum);
|
|
|
+ $returnData['unreadCount'] =$unreadCount;
|
|
|
+ $returnData['readCount'] =$readCount;
|
|
|
+ $returnData['cardList'] =$info;
|
|
|
+
|
|
|
+ common::echo_json_encode(200,$returnData);
|
|
|
+ exit();
|
|
|
+ }
|
|
|
+
|
|
|
+ if ($operate == "check_notifications_message"){
|
|
|
+ $checkUnread = "select id
|
|
|
+ from public.kln_notifiation_info ni
|
|
|
+ where lower(ni.user_login) in ('".strtolower(_getLoginName())."','all_user')
|
|
|
+ and (ni.frequency_type = 'Instant'
|
|
|
+ or (ni.frequency_type = 'Daily' and timezone(ni.daily_time_zone, NOW()::time) > ni.daily_time::time)
|
|
|
+ or (ni.frequency_type = 'Weekly' and timezone(ni.weekly_time_zone, NOW()::time) > ni.weekly_time::time
|
|
|
+ and ni.weekly_week ilike '%'|| EXTRACT(dow FROM timezone(ni.weekly_time_zone, NOW())) ||'%'))
|
|
|
+ and ni.notifications_method = true and is_send_message = false limit 1";
|
|
|
+ $unread = common::excuteObjectSql($checkUnread);
|
|
|
+ $returnData = array("has_message" =>!empty($unread));
|
|
|
+ common::echo_json_encode(200,$returnData);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -874,7 +990,8 @@ class tools {
|
|
|
}else{
|
|
|
//正常字段直接比较就行
|
|
|
$postValue = !empty($_POST[$filed]) ? $_POST[$filed] : "";
|
|
|
- if($postValue != $rule[$filed]){
|
|
|
+ $dbValue = !empty($rule[$filed]) ? $rule[$filed] : "";
|
|
|
+ if($postValue != $dbValue){
|
|
|
$range_flag = false;
|
|
|
}
|
|
|
}
|
|
|
@@ -902,7 +1019,8 @@ class tools {
|
|
|
}
|
|
|
} else {
|
|
|
$postValue = !empty($_POST[$filed]) ? $_POST[$filed] : "";
|
|
|
- if($postValue != $rule[$filed]){
|
|
|
+ $dbValue = !empty($rule[$filed]) ? $rule[$filed] : "";
|
|
|
+ if($postValue != $dbValue){
|
|
|
$details_flag = false;
|
|
|
}
|
|
|
}
|
|
|
@@ -914,7 +1032,8 @@ class tools {
|
|
|
$frequency_flag = true;
|
|
|
foreach($checkFrequencyFiled as $filed){
|
|
|
$postValue = !empty($_POST[$filed]) ? $_POST[$filed] : "";
|
|
|
- if($postValue != $rule[$filed]){
|
|
|
+ $dbValue = !empty($rule[$filed]) ? $rule[$filed] : "";
|
|
|
+ if($postValue != $dbValue){
|
|
|
$frequency_flag = false;
|
|
|
}
|
|
|
}
|
|
|
@@ -956,6 +1075,17 @@ class tools {
|
|
|
$sql_where = " and (ni.frequency_type = 'Weekly' and timezone(ni.weekly_time_zone, NOW()::time) > ni.weekly_time::time
|
|
|
and ni.weekly_week ilike '%'|| EXTRACT(dow FROM timezone(ni.weekly_time_zone, NOW())) ||'%')";
|
|
|
}
|
|
|
+ if (!empty($_REQUEST['current_time'])){
|
|
|
+ // $sql_where .= " and ni.insert_date >= TO_TIMESTAMP('".$_REQUEST['current_time']."', 'MM/DD/YYYY HH24:MI:SS') - interval '5 minutes'
|
|
|
+ // and ni.is_send_message = false";
|
|
|
+ //这里都以服务器时间,检查标准
|
|
|
+ $sql_where .= " and ni.insert_date >= now() - interval '5 minutes'
|
|
|
+ and ni.is_send_message = false";
|
|
|
+ }
|
|
|
+ if (!empty($_REQUEST['info_type']) && $_REQUEST['info_type'] == 'true'){
|
|
|
+ $sql_where .= " and ni.is_send_message = false";
|
|
|
+ }
|
|
|
+
|
|
|
//这里的查询会把不同日期的但hbol相同的信息,过滤掉只剩下最新的那一条。所以移除
|
|
|
$aa_where = "";
|
|
|
if (!empty($insert_date_format)){
|
|
|
@@ -968,9 +1098,9 @@ class tools {
|
|
|
case when ni.notifiation_type = 'Departure/Arrival_Delay' and ni.delay_unit = 'days'
|
|
|
then (EXTRACT(DAY FROM ((delay_act_date||' '||delay_act_time)::timestamp - (delay_est_date||' '||delay_est_time)::timestamp)))
|
|
|
when ni.notifiation_type = 'Departure/Arrival_Delay' and ni.delay_unit = 'hours'
|
|
|
- then (EXTRACT(HOUR FROM ((delay_act_date||' '||delay_act_time)::timestamp - (delay_est_date||' '||delay_est_time)::timestamp)))
|
|
|
+ then (FLOOR(EXTRACT(epoch FROM ((delay_act_date||' '||delay_act_time)::timestamp - (delay_est_date||' '||delay_est_time)::timestamp))/3600))
|
|
|
else 0
|
|
|
- end as delay_diff,
|
|
|
+ end as _delay_diff,
|
|
|
|
|
|
case when COALESCE(ni.frequency_type,'') = 'Daily'
|
|
|
then to_char(timezone(ni.daily_time_zone, ni.insert_date),'Mon DD, YYYY')
|
|
|
@@ -989,12 +1119,18 @@ class tools {
|
|
|
else ''
|
|
|
end as ctnr_previous_json,
|
|
|
|
|
|
+ case when ni.notifiation_type ='Container_Status_Update'
|
|
|
+ then (select description
|
|
|
+ from public.ra_online_edi_event e where e.ra_name = ni.ctnr_status_code limit 1)
|
|
|
+ else ''
|
|
|
+ end as ctnr_desc,
|
|
|
+
|
|
|
ccc.order_from,ccc.h_bol,ccc.transport_mode
|
|
|
from public.kln_notifiation_info ni
|
|
|
left join LATERAL (select oo.h_bol,oo.transport_mode,oo.order_from
|
|
|
from public.kln_ocean oo
|
|
|
where oo.serial_no = ni.serial_no limit 1) ccc on true
|
|
|
- where lower(ni.user_login) = '".strtolower(_getLoginName())."'
|
|
|
+ where lower(ni.user_login) in ('".strtolower(_getLoginName())."','all_user')
|
|
|
and lower(ni.notifiation_type) in ($more_param)
|
|
|
".$sql_where." and ni.notifications_method = true order by ni.insert_date desc) aa $aa_where";
|
|
|
error_log($sql);
|
|
|
@@ -1079,13 +1215,15 @@ class tools {
|
|
|
"order_from"=>$mInfo["order_from"],
|
|
|
"id"=>$mInfo["id"],
|
|
|
"insert_date_format"=>'',
|
|
|
+ "rules_type"=>$mInfo["notifiation_type"],
|
|
|
"info"=>new stdClass());
|
|
|
|
|
|
if ($mInfo["frequency_type"] == "Daily"){
|
|
|
$eventCard["numericRecords"] = !empty($mInfo["numericRecords"]) ? $mInfo["numericRecords"] : 0;
|
|
|
$eventCard["title"] = "Milestone Update Daily Summary(".$mInfo["insert_date_format"].")";
|
|
|
$eventCard["insert_date_format"] = $mInfo["insert_date_format"];
|
|
|
- $eventCard["previous"] = '';
|
|
|
+ //seeall 的时候,前端不需要id
|
|
|
+ $eventCard["id"] = '';
|
|
|
|
|
|
$milestone_previous = json_decode($mInfo["milestone_previous_json"],true);
|
|
|
if(!empty($milestone_previous['milestone']['milestone_date'])){
|
|
|
@@ -1098,6 +1236,8 @@ class tools {
|
|
|
$eventCard["numericRecords"] = !empty($mInfo["numericRecords"]) ? $mInfo["numericRecords"] : 0;
|
|
|
$eventCard["title"] = "Milestone Update Weekly Summary(".$mInfo["insert_date_format"].")";
|
|
|
$eventCard["insert_date_format"] = $mInfo["insert_date_format"];
|
|
|
+ //seeall 的时候,前端不需要id
|
|
|
+ $eventCard["id"] = '';
|
|
|
|
|
|
$milestone_previous = json_decode($mInfo["milestone_previous_json"],true);
|
|
|
if(!empty($milestone_previous['milestone']['milestone_date'])){
|
|
|
@@ -1106,18 +1246,19 @@ class tools {
|
|
|
"time" => $milestone_previous['milestone']['milestone_time'],
|
|
|
"timezone" =>$milestone_previous['milestone']['timezone']);
|
|
|
}
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
if($notifiation_type == "Container_Status_Update"){
|
|
|
- //当前状态的描述
|
|
|
- $ctnrStatusdesc = $this->getContainerStatusDesc($mInfo["ctnr_status_code"]);
|
|
|
+ //当前状态的描述ctnr_desc
|
|
|
+ //$ctnrStatusdesc = $this->getContainerStatusDesc($mInfo["ctnr_status_code"]);
|
|
|
$eventCard = array("type" =>'container',
|
|
|
"numericRecords"=>0,
|
|
|
"isRead"=>$mInfo["is_send_message"] == 't' ? true : false,
|
|
|
"title"=>"Container_Status_Update",
|
|
|
"mode"=>"Ocean Freight",
|
|
|
"no"=>$mInfo["ctnr"],
|
|
|
- "tag"=>$ctnrStatusdesc,
|
|
|
+ "tag"=>$mInfo["ctnr_desc"],
|
|
|
"location"=>$mInfo["ctnr_status_locations"],
|
|
|
"timezone"=>$mInfo["ctnr_status_timezone"],
|
|
|
"time"=>$mInfo["ctnr_status_date"]." ".$mInfo["ctnr_status_time"],
|
|
|
@@ -1128,12 +1269,15 @@ class tools {
|
|
|
"order_from"=>$mInfo["order_from"],
|
|
|
"id"=>$mInfo["id"],
|
|
|
"insert_date_format"=>'',
|
|
|
+ "rules_type"=>$mInfo["notifiation_type"],
|
|
|
"info"=>new stdClass());
|
|
|
|
|
|
if ($mInfo["frequency_type"] == "Daily"){
|
|
|
$eventCard["numericRecords"] = !empty($mInfo["numericRecords"]) ? $mInfo["numericRecords"] : 0;
|
|
|
$eventCard["title"] = "Container Status Update Daily Summary(".$mInfo["insert_date_format"].")";
|
|
|
$eventCard["insert_date_format"] = $mInfo["insert_date_format"];
|
|
|
+ //seeall 的时候,前端不需要id
|
|
|
+ $eventCard["id"] = '';
|
|
|
|
|
|
$ctnr_previous = json_decode($mInfo["ctnr_previous_json"],true);
|
|
|
if(!empty($ctnr_previous["ctnrStatus"]["date"])){
|
|
|
@@ -1147,6 +1291,8 @@ class tools {
|
|
|
$eventCard["numericRecords"] = !empty($mInfo["numericRecords"]) ? $mInfo["numericRecords"] : 0;
|
|
|
$eventCard["title"] = "Container Status Update Weekly Summary(".$mInfo["insert_date_format"].")";
|
|
|
$eventCard["insert_date_format"] = $mInfo["insert_date_format"];
|
|
|
+ //seeall 的时候,前端不需要id
|
|
|
+ $eventCard["id"] = '';
|
|
|
|
|
|
$ctnr_previous = json_decode($mInfo["ctnr_previous_json"],true);
|
|
|
if(!empty($ctnr_previous["ctnrStatus"]["date"])){
|
|
|
@@ -1195,7 +1341,7 @@ class tools {
|
|
|
}
|
|
|
$act_date = $mInfo["delay_act_date"]." ".$mInfo["delay_act_time"];
|
|
|
$est_date = $mInfo["delay_est_date"]." ".$mInfo["delay_est_time"];
|
|
|
- $delay_diff = $mInfo["delay_diff"];
|
|
|
+ $delay_diff = $mInfo["_delay_diff"];
|
|
|
$delay_unit = $mInfo["delay_unit"];
|
|
|
$eventCard = array("type" =>'delay',
|
|
|
"numericRecords"=>0,
|
|
|
@@ -1214,6 +1360,7 @@ class tools {
|
|
|
"order_from"=>$mInfo["order_from"],
|
|
|
"id"=>$mInfo["id"],
|
|
|
"insert_date_format"=>'',
|
|
|
+ "rules_type"=>$mInfo["notifiation_type"],
|
|
|
"info"=>array("route"=>$route,
|
|
|
"leg"=>$leg,
|
|
|
"etdOrdeparturNum"=>0,
|
|
|
@@ -1230,12 +1377,16 @@ class tools {
|
|
|
$eventCard["info"]["etaOrarrivalNum"] = !empty($mInfo["numericRecords_two"]) ? $mInfo["numericRecords_two"] : 0;
|
|
|
$eventCard["title"] = "Container Status Update Daily Summary(".$mInfo["insert_date_format"].")";
|
|
|
$eventCard["insert_date_format"] = $mInfo["insert_date_format"];
|
|
|
+ //seeall 的时候,前端不需要id
|
|
|
+ $eventCard["id"] = '';
|
|
|
} else if($mInfo["frequency_type"] == "Weekly"){
|
|
|
$eventCard["numericRecords"] = !empty($mInfo["numericRecords"]) ? $mInfo["numericRecords"] : 0;
|
|
|
$eventCard["info"]["etdOrdeparturNum"] = !empty($mInfo["numericRecords_one"]) ? $mInfo["numericRecords_one"] : 0;
|
|
|
$eventCard["info"]["etaOrarrivalNum"] = !empty($mInfo["numericRecords_two"]) ? $mInfo["numericRecords_two"] : 0;
|
|
|
$eventCard["title"] = "Container Status Update Weekly Summary(".$mInfo["insert_date_format"].")";
|
|
|
$eventCard["insert_date_format"] = $mInfo["insert_date_format"];
|
|
|
+ //seeall 的时候,前端不需要id
|
|
|
+ $eventCard["id"] = '';
|
|
|
}
|
|
|
}
|
|
|
if($notifiation_type == "ETD/ETA_Change"){
|
|
|
@@ -1277,6 +1428,7 @@ class tools {
|
|
|
"order_from"=>$mInfo["order_from"],
|
|
|
"id"=>$mInfo["id"],
|
|
|
"insert_date_format"=>'',
|
|
|
+ "rules_type"=>$mInfo["notifiation_type"],
|
|
|
"info"=>array("route"=>$route,
|
|
|
"leg"=>$leg,
|
|
|
"etdOrdeparturNum"=>0,
|
|
|
@@ -1293,14 +1445,34 @@ class tools {
|
|
|
$eventCard["info"]["etaOrarrivalNum"] = !empty($mInfo["numericRecords_two"]) ? $mInfo["numericRecords_two"] : 0;
|
|
|
$eventCard["title"] = "ETD/ETA Change Daily Summary(".$mInfo["insert_date_format"].")";
|
|
|
$eventCard["insert_date_format"] = $mInfo["insert_date_format"];
|
|
|
+ $eventCard["id"] = "";
|
|
|
} else if($mInfo["frequency_type"] == "Weekly"){
|
|
|
$eventCard["numericRecords"] = !empty($mInfo["numericRecords"]) ? $mInfo["numericRecords"] : 0;
|
|
|
$eventCard["info"]["etdOrdeparturNum"] = !empty($mInfo["numericRecords_one"]) ? $mInfo["numericRecords_one"] : 0;
|
|
|
$eventCard["info"]["etaOrarrivalNum"] = !empty($mInfo["numericRecords_two"]) ? $mInfo["numericRecords_two"] : 0;
|
|
|
$eventCard["title"] = "ETD/ETA Change Weekly Summary(".$mInfo["insert_date_format"].")";
|
|
|
$eventCard["insert_date_format"] = $mInfo["insert_date_format"];
|
|
|
+ $eventCard["id"] = "";
|
|
|
}
|
|
|
}
|
|
|
+ if($notifiation_type == "Feature_Update" || $notifiation_type == "Passwond_Notifcations"){
|
|
|
+ $title = $mInfo["other_type"] == "password" ? "Password Notifications" : "Feature Update";
|
|
|
+ $isExpiration = false;
|
|
|
+ if($title == "Password Notifications" and $mInfo["other_pnum"] <= 3){
|
|
|
+ $isExpiration = true;
|
|
|
+ }
|
|
|
+ $eventCard = array(
|
|
|
+ "title" => $title,
|
|
|
+ "id"=> $mInfo["id"],
|
|
|
+ "header"=> $mInfo["other_name"],
|
|
|
+ "content"=>$mInfo["other_desc"],
|
|
|
+ "isRead"=>$mInfo["is_send_message"] == 't' ? true : false,
|
|
|
+ "isExpiration"=> $isExpiration,
|
|
|
+ "rules_type"=>$mInfo["notifiation_type"],
|
|
|
+ "imgSrc"=>SERVER_PAHT.FILE_UPLOAD_PAHT."feature_update_".$mInfo["id"].".jpg",
|
|
|
+ "view_more_link" =>"main_new_version.php?action=feature_update&id=".$mInfo["id"]
|
|
|
+ );
|
|
|
+ }
|
|
|
return $eventCard;
|
|
|
}
|
|
|
|