|
@@ -556,15 +556,22 @@ class tools {
|
|
|
if ($operate == "notifications_message_init"){
|
|
if ($operate == "notifications_message_init"){
|
|
|
$rules_type = common::check_input($_REQUEST['rules_type']);
|
|
$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'
|
|
|
|
|
+ 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
|
|
"select
|
|
|
- sum(case when (1<>1 or (notifiation_type='Milestone_Update')) then 1 else 0 end) as sea_rc,
|
|
|
|
|
- sum(case when (1<>1 or (notifiation_type='sea')) then 1 else 0 end) as sea_rc,
|
|
|
|
|
- sum(case when (1<>1 or (notifiation_type='sea')) then 1 else 0 end) as sea_rc,
|
|
|
|
|
- sum(case when (1<>1 or (notifiation_type='sea')) then 1 else 0 end) as sea_rc,
|
|
|
|
|
- sum(case when (1<>1 or (notifiation_type='sea')) then 1 else 0 end) as sea_rc
|
|
|
|
|
|
|
+ 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
|
|
from public.kln_notifiation_info
|
|
|
where insert_date > NOW() - INTERVAL '1 year'
|
|
where insert_date > NOW() - INTERVAL '1 year'
|
|
|
- and notifications_method = 'true' and is_send_message = 'false'";
|
|
|
|
|
|
|
+ and frequency_type = 'Instant'
|
|
|
|
|
+ and notifications_method = 'true' and is_send_message = 'false'
|
|
|
|
|
+ and lower(ni.user_login) = '".strtolower(_getLoginName())."'";
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|