Browse Source

修复码牌激活商户数

lcl 1 year ago
parent
commit
e284e57ec8
1 changed files with 5 additions and 5 deletions
  1. 5 5
      AppStart/Helper/StatService.cs

+ 5 - 5
AppStart/Helper/StatService.cs

@@ -216,7 +216,7 @@ namespace MySystem
             KxsMainModels.WebCMSEntities maindb = new KxsMainModels.WebCMSEntities();
             try
             {
-                DataTable idsDt = CustomerSqlConn.dtable("select Id from MerchantInfo where ActStat=0 and ActivationStatus=1 and ActivationDate is not null and UserId>0 limit 50", AppConfig.Base.SqlConn);
+                DataTable idsDt = CustomerSqlConn.dtable("select Id from MerchantInfo where ActStat=0 and (Status=2 or QueryCount=2) and UserId>0 limit 50", AppConfig.Base.SqlConn);
                 if(idsDt.Rows.Count > 0)
                 {
                     string ids = "";
@@ -224,15 +224,15 @@ namespace MySystem
                     {
                         ids += idsDr["Id"].ToString() + ",";
                     }
-                    DataTable userDt = CustomerSqlConn.dtable("select UserId,DATE_FORMAT(ActivationDate, '%Y%m%d'),count(Id) from MerchantInfo where Id in (" + ids.TrimEnd(',') + ") group by UserId,DATE_FORMAT(ActivationDate, '%Y%m%d')", AppConfig.Base.SqlConn);
+                    DataTable userDt = CustomerSqlConn.dtable("select UserId,count(Id) from MerchantInfo where Id in (" + ids.TrimEnd(',') + ") group by UserId", AppConfig.Base.SqlConn);
                     if (userDt.Rows.Count > 0)
                     {
                         function.WriteLog("人数:" + userDt.Rows.Count + "\n\n", "实时执行创客激活数日志");
                         foreach (DataRow userDr in userDt.Rows)
                         {
-                            int UserId = int.Parse(userDr["BuyUserId"].ToString());
-                            string TradeDate = userDr[3].ToString();
-                            int ActCount = int.Parse(function.CheckInt(userDr[4].ToString()));
+                            int UserId = int.Parse(userDr["UserId"].ToString());
+                            string TradeDate = DateTime.Now.ToString("yyyyMMdd");
+                            int ActCount = int.Parse(function.CheckInt(userDr[1].ToString()));
                             string TradeMonth = TradeDate.Substring(0, 6);
                             string date = TradeDate.Substring(0, 4) + "-" + TradeDate.Substring(4, 2) + "-" + TradeDate.Substring(6, 2);
                             string start = date + " 00:00:00";