Pārlūkot izejas kodu

修复统计bug

lcl 8 mēneši atpakaļ
vecāks
revīzija
7aa4563448

+ 2 - 2
AppStart/Helper/StatGdNewService.cs

@@ -48,7 +48,7 @@ namespace MySystem
             {
                 try
                 {
-                    string start = "2024-10-01 00:00:00";
+                    string start = "2025-01-01 00:00:00";
                     DataTable idsDt = CustomerSqlConn.dtable("select Id from ConsumerOrders where Id>=333068 and CreateDate>='" + start + "' and Status>0 and Version=2 order by Id limit 50", connstr);
                     if(idsDt.Rows.Count > 0)
                     {
@@ -70,8 +70,8 @@ namespace MySystem
                                 if (UserId == 0)
                                 {
                                     UserId = pos.UserId;
-                                    BindTime = pos.BindingTime.Value;
                                 }
+                                if(pos.BindingTime != null) BindTime = pos.BindingTime.Value;
                                 KxsMainModels.Users user = maindb.Users.FirstOrDefault(m => m.Id == UserId) ?? new KxsMainModels.Users();
                                 string ParentNav = user.ParentNav; //selfDr["ParentNav"].ToString();
                                 if (BindTime < DateTime.Now.AddMonths(-9))

+ 3 - 4
AppStart/Helper/StatGdNewService2.cs

@@ -51,7 +51,7 @@ namespace MySystem
             {
                 try
                 {
-                    string start = "2024-10-01 00:00:00";
+                    string start = "2025-01-01 00:00:00";
                     DataTable idsDt = CustomerSqlConn.dtable("select Id from ConsumerOrders where Id>=3344113 and CreateDate>='" + start + "' and Status>0 and Version=2 order by Id limit 100", connstr);
                     if(idsDt.Rows.Count > 0)
                     {
@@ -76,14 +76,13 @@ namespace MySystem
                                     KxsMachine pos = pdb.KxsMachine.FirstOrDefault(m => m.PosSn == SnNo && m.BindStatus == 1);
                                     if(pos != null)
                                     {
-                                        UserId = pos.UserId;
+                                        if(pos.BindTime != null) BindTime = pos.BindTime.Value;
                                     }
                                 }
                                 else
                                 {
                                     PxcModels.PosMachinesTwo pos = db1.PosMachinesTwo.FirstOrDefault(m => m.PosSn == SnNo) ?? new PxcModels.PosMachinesTwo();
-                                    UserId = pos.UserId;
-                                    BindTime = pos.BindingTime.Value;
+                                    if(pos.BindingTime != null) BindTime = pos.BindingTime.Value;
                                 }
                                 KxsMainModels.Users user = maindb.Users.FirstOrDefault(m => m.Id == UserId) ?? new KxsMainModels.Users();
                                 string ParentNav = user.ParentNav; //selfDr["ParentNav"].ToString();