|
|
@@ -751,7 +751,7 @@ class tools {
|
|
|
else ''
|
|
|
end as insert_date_format
|
|
|
from public.kln_notifiation_info ni
|
|
|
- where ni.insert_date > NOW() - INTERVAL '1 year'
|
|
|
+ where ni.insert_date > NOW() - INTERVAL '3 months'
|
|
|
and ni.notifications_method = 'true' and ni.is_send_message is null
|
|
|
and lower(ni.user_login) = '".strtolower(_getLoginName())."'
|
|
|
and ((ni.frequency_type = 'Daily'
|
|
|
@@ -771,7 +771,7 @@ class tools {
|
|
|
union all
|
|
|
select ni.notifiation_type, '' as insert_date_format
|
|
|
from public.kln_notifiation_info ni
|
|
|
- where ni.insert_date > NOW() - INTERVAL '1 year'
|
|
|
+ where ni.insert_date > NOW() - INTERVAL '3 months'
|
|
|
and lower(ni.user_login) in ('".strtolower(_getLoginName())."','all_user')
|
|
|
and ni.notifications_method = 'true' and ni.is_send_message is null
|
|
|
and frequency_type = 'Instant'
|
|
|
@@ -875,7 +875,7 @@ class tools {
|
|
|
else ''
|
|
|
end as insert_date_format
|
|
|
from public.kln_notifiation_info ni
|
|
|
- where ni.insert_date > NOW() - INTERVAL '1 year'
|
|
|
+ where ni.insert_date > NOW() - INTERVAL '3 months'
|
|
|
and ni.notifications_method = 'true' and ni.is_send_message is null
|
|
|
and lower(ni.user_login) = '".strtolower(_getLoginName())."'
|
|
|
and ((ni.frequency_type = 'Daily'
|
|
|
@@ -895,7 +895,7 @@ class tools {
|
|
|
union all
|
|
|
select ni.notifiation_type, '' as insert_date_format
|
|
|
from public.kln_notifiation_info ni
|
|
|
- where ni.insert_date > NOW() - INTERVAL '1 year'
|
|
|
+ where ni.insert_date > NOW() - INTERVAL '3 months'
|
|
|
and lower(ni.user_login) in ('".strtolower(_getLoginName())."','all_user')
|
|
|
and ni.notifications_method = 'true' and ni.is_send_message is null
|
|
|
and frequency_type = 'Instant'
|
|
|
@@ -1663,7 +1663,7 @@ class tools {
|
|
|
where oo.serial_no = ni.serial_no limit 1) ccc on true
|
|
|
left join LATERAL (select COALESCE(ke.default_time_zone,'UTC-08') as default_time_zone from public.kln_user_extend ke where lower(ke.user_login) = lower(ni.user_login) limit 1) ddd on true
|
|
|
where lower(ni.user_login) in ('".strtolower(_getLoginName())."','all_user')
|
|
|
- and ni.insert_date > NOW() - INTERVAL '1 year'
|
|
|
+ and ni.insert_date > NOW() - INTERVAL '3 months'
|
|
|
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);
|
|
|
@@ -1785,15 +1785,12 @@ class tools {
|
|
|
|
|
|
$cp = common::check_input($_REQUEST['cp']); //current_page
|
|
|
$ps = common::check_input($_REQUEST['ps']); //ps
|
|
|
- if (empty($ps)){
|
|
|
- $ps = 20;
|
|
|
- }
|
|
|
- if (empty($cp)){
|
|
|
- $cp = 1;
|
|
|
+ if (empty($ps) || empty($cp)){
|
|
|
+ $limit_param = " ";
|
|
|
+ } else {
|
|
|
+ $limit_param = " limit " . $ps . " offset " . ($cp - 1) * $ps;
|
|
|
}
|
|
|
- //$limit_param = " limit " . $ps . " offset " . ($cp - 1) * $ps;
|
|
|
- $limit_param = " ";
|
|
|
-
|
|
|
+
|
|
|
$sql = "WITH base_data AS (
|
|
|
SELECT
|
|
|
id,
|
|
|
@@ -1817,7 +1814,7 @@ class tools {
|
|
|
date_change_name
|
|
|
FROM public.kln_notifiation_info ni
|
|
|
WHERE lower(ni.user_login) in ('".strtolower(_getLoginName())."','all_user')
|
|
|
- AND ni.insert_date > NOW() - INTERVAL '1 year'
|
|
|
+ AND ni.insert_date > NOW() - INTERVAL '3 months'
|
|
|
and lower(ni.notifiation_type) in ($more_param)
|
|
|
AND frequency_type IN ('Daily', 'Weekly')
|
|
|
".$sql_where." and ni.notifications_method = true
|
|
|
@@ -1825,7 +1822,7 @@ class tools {
|
|
|
base_instant_data AS (
|
|
|
SELECT id,insert_date FROM public.kln_notifiation_info ni
|
|
|
WHERE lower(ni.user_login) in ('".strtolower(_getLoginName())."','all_user')
|
|
|
- AND ni.insert_date > NOW() - INTERVAL '1 year'
|
|
|
+ AND ni.insert_date > NOW() - INTERVAL '3 months'
|
|
|
and lower(ni.notifiation_type) in ($more_param)
|
|
|
AND frequency_type = 'Instant'
|
|
|
".$sql_where." and ni.notifications_method = true
|
|
|
@@ -2021,14 +2018,12 @@ class tools {
|
|
|
|
|
|
$cp = common::check_input($_REQUEST['cp']); //current_page
|
|
|
$ps = common::check_input($_REQUEST['ps']); //ps
|
|
|
- if (empty($ps)){
|
|
|
- $ps = 20;
|
|
|
- }
|
|
|
- if (empty($cp)){
|
|
|
- $cp = 1;
|
|
|
+
|
|
|
+ if (empty($ps) || empty($cp)){
|
|
|
+ $limit_param = " ";
|
|
|
+ } else {
|
|
|
+ $limit_param = " limit " . $ps . " offset " . ($cp - 1) * $ps;
|
|
|
}
|
|
|
- //$limit_param = " limit " . $ps . " offset " . ($cp - 1) * $ps;
|
|
|
- $limit_param = " ";
|
|
|
|
|
|
$sql = "select *
|
|
|
from (select ni.*,
|
|
|
@@ -2089,7 +2084,7 @@ class tools {
|
|
|
else ''
|
|
|
end as insert_date_format) eee on true
|
|
|
where lower(ni.user_login) in ('".strtolower(_getLoginName())."','all_user')
|
|
|
- and ni.insert_date > NOW() - INTERVAL '1 year'
|
|
|
+ and ni.insert_date > NOW() - INTERVAL '3 months'
|
|
|
and lower(ni.notifiation_type) in ($more_param)
|
|
|
".$sql_where." and ni.notifications_method = true order by ni.insert_date desc) aa
|
|
|
WHERE rn = 1 ORDER BY insert_date DESC " .$limit_param;
|