ShuanghongS 7 months ago
parent
commit
e8b4d823a7
2 changed files with 12 additions and 6 deletions
  1. 1 1
      main_new_version.php
  2. 11 5
      service/tools.class.php

+ 1 - 1
main_new_version.php

@@ -622,7 +622,7 @@ switch ($action) {
                         END AS new_status
                     FROM public.kln_ocean $sqlWhere";
             //$sqlWhere  and last_status_315_update_time is not null";
-            $sql .= " ORDER BY eta DESC limit " . $ps . " offset " . ($cp - 1) * $ps;
+            $sql .= " ORDER BY eta,id desc DESC limit " . $ps . " offset " . ($cp - 1) * $ps;
             //$sql .= " ORDER BY last_status_315_update_time DESC limit " . $ps . " offset " . ($cp - 1) * $ps;
             $rss = common::excuteListSql($sql);
             //RecentStatusList

+ 11 - 5
service/tools.class.php

@@ -583,7 +583,13 @@ class tools {
                 where ni.insert_date > NOW() - INTERVAL '1 year' 
                     and ni.notifications_method = 'true' and ni.is_send_message is null
                     and lower(ni.user_login) = '".strtolower(_getLoginName())."'
-                    and ni.frequency_type in ('Daily','Weekly')  group by ni.notifiation_type,insert_date_format 
+                    and ((ni.frequency_type = 'Daily'  
+                                and timezone(ni.daily_time_zone, NOW()::time) > ni.daily_time::time 
+                                and ni.insert_date::date <= CURRENT_DATE + 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.insert_date::date <= CURRENT_DATE + ni.weekly_time::time)) 
+                      group by ni.notifiation_type,insert_date_format 
             union all
                 select ni.notifiation_type, '' as insert_date_format  
                     from  public.kln_notifiation_info ni
@@ -1344,7 +1350,7 @@ class tools {
                     "timeLabel"=>"",
                     "previous"=>"",
                     "frequency_type"=>$mInfo["frequency_type"],
-                    "serial_no"=>$mInfo["serial_no"],
+                    "serial_no"=>common::deCode($mInfo["serial_no"], 'E'),
                     "order_from"=>$mInfo["order_from"], 
                     "id"=>$mInfo["id"],
                     "insert_date_format"=>'',
@@ -1398,7 +1404,7 @@ class tools {
                     "timeLabel"=>"",
                     "previous"=>"",
                     "frequency_type"=>$mInfo["frequency_type"],
-                    "serial_no"=>$mInfo["serial_no"],
+                    "serial_no"=>common::deCode($mInfo["serial_no"], 'E'),
                     "order_from"=>$mInfo["order_from"],
                     "id"=>$mInfo["id"],
                     "insert_date_format"=>'',
@@ -1489,7 +1495,7 @@ class tools {
                     "timeLabel"=>$outsideTimeLabel,
                     "previous"=>"",
                     "frequency_type"=>$mInfo["frequency_type"],
-                    "serial_no"=>$mInfo["serial_no"],
+                    "serial_no"=>common::deCode($mInfo["serial_no"], 'E'),
                     "order_from"=>$mInfo["order_from"],
                     "id"=>$mInfo["id"],
                     "insert_date_format"=>'',
@@ -1557,7 +1563,7 @@ class tools {
                     "timeLabel"=>$outsideTimeLabel,
                     "previous"=>"",
                     "frequency_type"=>$mInfo["frequency_type"],
-                    "serial_no"=>$mInfo["serial_no"],
+                    "serial_no"=>common::deCode($mInfo["serial_no"], 'E'),
                     "order_from"=>$mInfo["order_from"],
                     "id"=>$mInfo["id"],
                     "insert_date_format"=>'',