ShuanghongS il y a 9 mois
Parent
commit
eb5e53af7c
2 fichiers modifiés avec 16 ajouts et 9 suppressions
  1. 3 3
      main_new_version.php
  2. 13 6
      service/tools.class.php

+ 3 - 3
main_new_version.php

@@ -20,9 +20,9 @@ include 'service/login.class.php';
 include 'service/tools.class.php';
 
 //为了调用,临时做一个登录动作
- $_POST['uname'] = "ra.admin";
- $_POST['psw'] = common::excuteOneSql("select ra_password from public.ra_online_user where user_login = 'ra.admin'");
- login::getInstance()->do_login_auto();
+//  $_POST['uname'] = "ra.admin";
+//  $_POST['psw'] = common::excuteOneSql("select ra_password from public.ra_online_user where user_login = 'ra.admin'");
+//  login::getInstance()->do_login_auto();
 //验证路由权限
 common::securityCheckHandNew($action);
 if (_is_only_vgm()) {

+ 13 - 6
service/tools.class.php

@@ -556,15 +556,22 @@ 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'
+                    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 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 
             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())."'";
         }
     }