Kaynağa Gözat

整理交易统计
开启分润程序

lichunlei 2 yıl önce
ebeveyn
işleme
89cd13ad95

+ 34 - 15
AppStart/Helper/StatService.cs

@@ -30,6 +30,7 @@ namespace MySystem
                     // dosomething2(doDate);
                     StartEverDay(doDate);
                     // StartEverDayV2(doDate);
+                    StatMerchantTrade(doDate);
                     dosomething4(doDate);
                     ListenFluxRecord(doDate);
                 }
@@ -1417,20 +1418,21 @@ namespace MySystem
             //     th.Start(check.ToString("yyyy-MM-dd"));
             //     check = check.AddDays(1);
             // }
-            if (DateTime.Now.Day == 2)
+            string TradeMonth = DateTime.Now.ToString("yyyyMM");
+            if(DateTime.Now.Day == 1)
             {
-                OtherMySqlConn.op("update Users set ThisMonthTrade=0 where ThisMonthTrade>0");
-                DataTable list = OtherMySqlConn.dtable("select UserId,sum(NonDirectTradeAmt) from UserTradeDaySummary where TradeMonth='" + DateTime.Now.ToString("yyyyMM") + "' GROUP BY UserId");
-                foreach (DataRow dr in list.Rows)
-                {
-                    string UserId = dr["UserId"].ToString();
-                    string ThisMonthTrade = dr[1].ToString();
-                    OtherMySqlConn.op("update Users set ThisMonthTrade=" + ThisMonthTrade + " where Id=" + UserId);
-                }
+                TradeMonth = DateTime.Now.AddMonths(-1).ToString("yyyyMM");
             }
-            Thread th = new Thread(StatTradeAmountEverDay);
-            th.IsBackground = true;
-            th.Start(date);
+            DataTable list = OtherMySqlConn.dtable("select UserId,sum(HelpNonDirectTradeAmt+NotHelpNonDirectTradeAmt) from TradeDaySummary where TradeMonth='" + TradeMonth + "' and SeoTitle='team' GROUP BY UserId");
+            foreach (DataRow dr in list.Rows)
+            {
+                string UserId = dr["UserId"].ToString();
+                string ThisMonthTrade = dr[1].ToString();
+                OtherMySqlConn.op("update Users set ThisMonthTrade=" + ThisMonthTrade + " where Id=" + UserId);
+            }
+            // Thread th = new Thread(StatTradeAmountEverDay);
+            // th.IsBackground = true;
+            // th.Start(date);
         }
         public void StatTradeAmountEverDay(object sender)
         {
@@ -1696,6 +1698,23 @@ namespace MySystem
             th.Start();
         }
         public void StatUserLevelDo()
+        {
+            while (true)
+            {
+                if(DateTime.Now.Month == 1 && DateTime.Now.Hour > 1)
+                {
+                    string Month = DateTime.Now.AddDays(-1).ToString("yyyy-MM");
+                    string flag = function.ReadInstance("/ProfitFlag/" + Month + ".txt");
+                    if (string.IsNullOrEmpty(flag))
+                    {
+                        function.WritePage("/ProfitFlag/", Month + ".txt", DateTime.Now.ToString("HH:mm:ss"));
+                        StatUserLevelStart();
+                    }
+                }
+                Thread.Sleep(60000);
+            }
+        }
+        public void StatUserLevelStart()
         {
             WebCMSEntities db = new WebCMSEntities();
             try
@@ -1715,10 +1734,10 @@ namespace MySystem
                         int BeforeLevel = user.UserLevel;
                         int AfterLevel = 0;
                         decimal TradeAmount = 0;
-                        bool check = db.UserTradeDaySummary.Any(m => m.UserId == user.Id && m.TradeMonth == TradeMonth && m.SeoTitle == "team");
+                        bool check = db.TradeDaySummary.Any(m => m.UserId == user.Id && m.TradeMonth == TradeMonth && m.SeoTitle == "team");
                         if (check)
                         {
-                            TradeAmount = db.UserTradeDaySummary.Where(m => m.UserId == user.Id && m.TradeMonth == TradeMonth && m.SeoTitle == "team").Sum(m => m.NonDirectTradeAmt);
+                            TradeAmount = db.TradeDaySummary.Where(m => m.UserId == user.Id && m.TradeMonth == TradeMonth && m.SeoTitle == "team").Sum(m => m.HelpDirectTradeAmt + m.NotHelpDirectTradeAmt);
                         }
                         UserLevelSet set = sets.FirstOrDefault(m => m.UpLevelGrowth <= TradeAmount && m.UpLevelIntegral > TradeAmount);
                         if (set != null)
@@ -1742,7 +1761,7 @@ namespace MySystem
                                 OperateDate = DateTime.Now, //操作时间
                             });
                             db.SaveChanges();
-                            RedisDbconn.Instance.Set("UserLevelData:" + user.Id, BeforeLevel + "#" + AfterLevel);
+                            // RedisDbconn.Instance.Set("UserLevelData:" + user.Id, BeforeLevel + "#" + AfterLevel);
                         }
                     }
                 }

+ 91 - 91
AppStart/Helper/TestService.cs

@@ -298,97 +298,97 @@ namespace MySystem
         public List<ProfitResult> StartProftForPosByDate(int BrandId, int UserId, decimal HelpDirectTradeAmt)
         {
             List<ProfitResult> result = new List<ProfitResult>();
-            ProfitObjects obj = RedisDbconn.Instance.Get<ProfitObjects>("pobj" + BrandId);
-            if (obj.Status == 1) //判断分润是否开启
-            {
-                WebCMSEntities dbnew = new WebCMSEntities();
-                try
-                {
-                    List<UserLevelSet> levels = dbnew.UserLevelSet.ToList();
-                    Users selfUser = dbnew.Users.FirstOrDefault(m => m.Id == UserId) ?? new Users();
-                    int Days = int.Parse(RedisDbconn.Instance.Get<string>("pobjrule:" + BrandId + ":HelpPolicy:Days")); //天数
-                    int maxLevel = obj.MaxLevel; //最大等级
-                    decimal diffLevelProfit = 0;  //等级级差
-                    int curLevel = 0; //当前层级的会员等级
-                    string ParentNav = selfUser.ParentNav;
-                    if (string.IsNullOrEmpty(ParentNav))
-                    {
-                        ParentNav = ",0,";
-                    }
-                    if (!string.IsNullOrEmpty(ParentNav))
-                    {
-                        ParentNav += "," + UserId + ",";
-                        string[] ParentNavList = ParentNav.Trim(',').Replace(",,", ",").Split(',');
-                        Array.Reverse(ParentNavList); //反转顺序
-                        int level = 0;
-                        DateTime now = DateTime.Now;
-                        if (HelpDirectTradeAmt > 0)
-                        {
-                            foreach (string UserIdString in ParentNavList)
-                            {
-                                level += 1;
-                                int uid = int.Parse(UserIdString);
-                                Users user = dbnew.Users.FirstOrDefault(m => m.Id == uid) ?? new Users();
-                                int UserLevel = user.UserLevel; //当前会员等级
-                                UserRankWhite rank = dbnew.UserRankWhite.FirstOrDefault(m => m.Id == user.Id && m.UpdateDate > now);
-                                if (rank != null)
-                                {
-                                    if (rank.Rank > UserLevel)
-                                    {
-                                        UserLevel = rank.Rank;
-                                    }
-                                }
-                                if (curLevel == maxLevel) //判断当前创客是否有直推的激活机具,并且在活动时间内
-                                {
-                                    break;
-                                }
-                                if (UserLevel <= maxLevel && UserLevel > curLevel)
-                                {
-                                    int LevelKindId = ProfitHelperV2.Instance.GetLevelKindId(BrandId, 1, 1);
-                                    ProfitObjectLevels objlevel = RedisDbconn.Instance.Get<ProfitObjectLevels>("pobjlv" + LevelKindId + ":" + UserLevel); //获取当前等级参数
-                                    int LevelKindId2 = ProfitHelperV2.Instance.GetLevelKindId(BrandId, 0, 1);
-                                    ProfitObjectLevels objlevel2 = RedisDbconn.Instance.Get<ProfitObjectLevels>("pobjlv" + LevelKindId2 + ":" + UserLevel); //获取当前等级参数
-                                    if (objlevel != null && objlevel2 != null)
-                                    {
-                                        decimal getLevelProfit = 0;  //等级分润
-                                        if (objlevel.Percents > 0 && objlevel2.Percents > 0)
-                                        {
-                                            //获取创客分润规则,注册日开始算起,3个自然月内算扶持期
-                                            getLevelProfit += HelpDirectTradeAmt * (objlevel.Percents - objlevel2.Percents);
-                                        }
-                                        decimal money = getLevelProfit;
-                                        getLevelProfit -= diffLevelProfit;
-                                        diffLevelProfit = money;
-                                        if (getLevelProfit >= obj.MinProfitVal)
-                                        {
-                                            result.Add(new ProfitResult()
-                                            {
-                                                UserId = user.Id,
-                                                UserNav = user.ParentNav,
-                                                Money = PublicFunction.NumberFormat(getLevelProfit),
-                                                ProfitRate = objlevel.Percents,
-                                                Message = "交易分润",
-                                                BankCardType = 1,
-                                                DirectFlag = selfUser.Id == user.Id ? 1 : 0,
-                                                BrandId = BrandId,
-                                                IsSubsidy = 0,
-                                                TradeAmount = HelpDirectTradeAmt,
-                                                HelpFlag = 1,
-                                            });
-                                        }
-                                    }
-                                }
-                                curLevel = UserLevel;
-                            }
-                        }
-                    }
-                }
-                catch (Exception ex)
-                {
-                    function.WriteLog(DateTime.Now.ToString() + "\n" + ex.ToString(), "每月统计分润异常");
-                }
-                dbnew.Dispose();
-            }
+            // ProfitObjects obj = RedisDbconn.Instance.Get<ProfitObjects>("pobj" + BrandId);
+            // if (obj.Status == 1) //判断分润是否开启
+            // {
+            //     WebCMSEntities dbnew = new WebCMSEntities();
+            //     try
+            //     {
+            //         List<UserLevelSet> levels = dbnew.UserLevelSet.ToList();
+            //         Users selfUser = dbnew.Users.FirstOrDefault(m => m.Id == UserId) ?? new Users();
+            //         int Days = int.Parse(RedisDbconn.Instance.Get<string>("pobjrule:" + BrandId + ":HelpPolicy:Days")); //天数
+            //         int maxLevel = obj.MaxLevel; //最大等级
+            //         decimal diffLevelProfit = 0;  //等级级差
+            //         int curLevel = 0; //当前层级的会员等级
+            //         string ParentNav = selfUser.ParentNav;
+            //         if (string.IsNullOrEmpty(ParentNav))
+            //         {
+            //             ParentNav = ",0,";
+            //         }
+            //         if (!string.IsNullOrEmpty(ParentNav))
+            //         {
+            //             ParentNav += "," + UserId + ",";
+            //             string[] ParentNavList = ParentNav.Trim(',').Replace(",,", ",").Split(',');
+            //             Array.Reverse(ParentNavList); //反转顺序
+            //             int level = 0;
+            //             DateTime now = DateTime.Now;
+            //             if (HelpDirectTradeAmt > 0)
+            //             {
+            //                 foreach (string UserIdString in ParentNavList)
+            //                 {
+            //                     level += 1;
+            //                     int uid = int.Parse(UserIdString);
+            //                     Users user = dbnew.Users.FirstOrDefault(m => m.Id == uid) ?? new Users();
+            //                     int UserLevel = user.UserLevel; //当前会员等级
+            //                     UserRankWhite rank = dbnew.UserRankWhite.FirstOrDefault(m => m.Id == user.Id && m.UpdateDate > now);
+            //                     if (rank != null)
+            //                     {
+            //                         if (rank.Rank > UserLevel)
+            //                         {
+            //                             UserLevel = rank.Rank;
+            //                         }
+            //                     }
+            //                     if (curLevel == maxLevel) //判断当前创客是否有直推的激活机具,并且在活动时间内
+            //                     {
+            //                         break;
+            //                     }
+            //                     if (UserLevel <= maxLevel && UserLevel > curLevel)
+            //                     {
+            //                         int LevelKindId = ProfitHelperV2.Instance.GetLevelKindId(BrandId, 1, 1);
+            //                         ProfitObjectLevels objlevel = RedisDbconn.Instance.Get<ProfitObjectLevels>("pobjlv" + LevelKindId + ":" + UserLevel); //获取当前等级参数
+            //                         int LevelKindId2 = ProfitHelperV2.Instance.GetLevelKindId(BrandId, 0, 1);
+            //                         ProfitObjectLevels objlevel2 = RedisDbconn.Instance.Get<ProfitObjectLevels>("pobjlv" + LevelKindId2 + ":" + UserLevel); //获取当前等级参数
+            //                         if (objlevel != null && objlevel2 != null)
+            //                         {
+            //                             decimal getLevelProfit = 0;  //等级分润
+            //                             if (objlevel.Percents > 0 && objlevel2.Percents > 0)
+            //                             {
+            //                                 //获取创客分润规则,注册日开始算起,3个自然月内算扶持期
+            //                                 getLevelProfit += HelpDirectTradeAmt * (objlevel.Percents - objlevel2.Percents);
+            //                             }
+            //                             decimal money = getLevelProfit;
+            //                             getLevelProfit -= diffLevelProfit;
+            //                             diffLevelProfit = money;
+            //                             if (getLevelProfit >= obj.MinProfitVal)
+            //                             {
+            //                                 result.Add(new ProfitResult()
+            //                                 {
+            //                                     UserId = user.Id,
+            //                                     UserNav = user.ParentNav,
+            //                                     Money = PublicFunction.NumberFormat(getLevelProfit),
+            //                                     ProfitRate = objlevel.Percents,
+            //                                     Message = "交易分润",
+            //                                     BankCardType = 1,
+            //                                     DirectFlag = selfUser.Id == user.Id ? 1 : 0,
+            //                                     BrandId = BrandId,
+            //                                     IsSubsidy = 0,
+            //                                     TradeAmount = HelpDirectTradeAmt,
+            //                                     HelpFlag = 1,
+            //                                 });
+            //                             }
+            //                         }
+            //                     }
+            //                     curLevel = UserLevel;
+            //                 }
+            //             }
+            //         }
+            //     }
+            //     catch (Exception ex)
+            //     {
+            //         function.WriteLog(DateTime.Now.ToString() + "\n" + ex.ToString(), "每月统计分润异常");
+            //     }
+            //     dbnew.Dispose();
+            // }
             return result;
         }
     }

+ 56 - 56
Controllers/HomeController.cs

@@ -965,61 +965,61 @@ namespace MySystem.Controllers
 
         //重置交易额,重置分润(直营)
         // /home/resetProfit?uid=120687&m=2022-06&bid=1
-        public string resetProfit(int uid, string m, int bid)
-        {
-            string result = "";
-            OtherMySqlConn.connstr = "server=47.109.31.237;port=3306;user=KxsMainServer2;password=FrW8ZfxlcaVdm1r0;database=KxsMainServer2;charset=utf8;";
-            DateTime start = DateTime.Parse(m + "-01 00:00:00");
-            DateTime end = start.AddMonths(1);
-            decimal ProfitAmt = 0;
-            while(start < end)
-            {
-                DateTime endDay = start.AddDays(1);
-                DataTable dt = OtherMySqlConn.dtable("select sum(HelpDirectTradeAmt) as HelpDirectTradeAmt,sum(NotHelpDirectTradeAmt) as NotHelpDirectTradeAmt from TradeDaySummary where UserId=" + uid + " and TradeDate='" + start.ToString("yyyyMMdd") + "' and SeoTitle='self' and BrandId=" + bid);
-                if(dt.Rows.Count > 0)
-                {
-                    decimal HelpDirectTradeAmt = decimal.Parse(function.CheckNum(dt.Rows[0]["HelpDirectTradeAmt"].ToString()));
-                    decimal NotHelpDirectTradeAmt = decimal.Parse(function.CheckNum(dt.Rows[0]["NotHelpDirectTradeAmt"].ToString()));
-                    result += "扶持期:" + HelpDirectTradeAmt + ",稳定期:" + NotHelpDirectTradeAmt + ";\n";
-                    dt = OtherMySqlConn.dtable("select sum(if(MerHelpFlag=1,TradeAmount,0)) as HelpAmt,sum(if(MerHelpFlag=0,TradeAmount,0)) as NotHelpAmt from TradeRecord where CreateDate>='" + start.ToString("yyyy-MM-dd HH:mm:ss") + "' and CreateDate<'" + endDay.ToString("yyyy-MM-dd HH:mm:ss") + "' and UserId=" + uid + " and BrandId=" + bid);
-                    if(dt.Rows.Count > 0)
-                    {
-                        decimal HelpAmt = decimal.Parse(function.CheckNum(dt.Rows[0]["HelpAmt"].ToString()));
-                        decimal NotHelpAmt = decimal.Parse(function.CheckNum(dt.Rows[0]["NotHelpAmt"].ToString()));
-                        result += "update TradeDaySummary set HelpDirectTradeAmt=" + HelpAmt + ",NotHelpDirectTradeAmt=" + NotHelpAmt + " where UserId=" + uid + " and TradeDate='" + start.ToString("yyyyMMdd") + "' and SeoTitle='self' and BrandId=" + bid + ";\n\n";
-                        dt = OtherMySqlConn.dtable("select UserLevel from Users where Id=" + uid + "");
-                        if(dt.Rows.Count > 0)
-                        {
-                            int UserLevel = int.Parse(function.CheckInt(dt.Rows[0]["UserLevel"].ToString()));
-                            dt = OtherMySqlConn.dtable("select Rank from UserRankWhite where Id=" + uid + "");
-                            if(dt.Rows.Count > 0)
-                            {
-                                UserLevel = int.Parse(function.CheckInt(dt.Rows[0]["Rank"].ToString()));
-                            }
-                            int LevelKindId = ProfitHelperV2.Instance.GetLevelKindId(bid, 1, 1);
-                            ProfitObjectLevels objlevel = RedisDbconn.Instance.Get<ProfitObjectLevels>("pobjlv" + LevelKindId + ":" + UserLevel) ?? new ProfitObjectLevels();
-                            ProfitAmt += HelpAmt * objlevel.Percents;
-                            LevelKindId = ProfitHelperV2.Instance.GetLevelKindId(bid, 0, 1);
-                            objlevel = RedisDbconn.Instance.Get<ProfitObjectLevels>("pobjlv" + LevelKindId + ":" + UserLevel) ?? new ProfitObjectLevels();
-                            ProfitAmt += NotHelpAmt * objlevel.Percents;
-                        }
-                    }
-                }
-                start = start.AddDays(1);
-            }
-            DataTable dt2 = OtherMySqlConn.dtable("select Id,ProfitAmount from ProfitRecord where UserId=" + uid + " and SeoTitle='" + m.Replace("-", "") + "' and DirectFlag=1 and BrandId=" + bid);
-            if(dt2.Rows.Count > 0)
-            {
-                int Id = int.Parse(function.CheckInt(dt2.Rows[0]["Id"].ToString()));
-                decimal ProfitAmount = decimal.Parse(function.CheckNum(dt2.Rows[0]["ProfitAmount"].ToString()));
-                result += "当前分润:" + ProfitAmount + ";\n";
-                if(ProfitAmount != ProfitAmt)
-                {
-                    result += "update ProfitRecord set ProfitAmount=" + ProfitAmt + " where UserId=" + uid + " and SeoTitle='" + m.Replace("-", "") + "' and DirectFlag=1 and BrandId=" + bid + ";\n";
-                }
-            }
-            OtherMySqlConn.connstr = "";
-            return result;
-        }
+        // public string resetProfit(int uid, string m, int bid)
+        // {
+        //     string result = "";
+        //     OtherMySqlConn.connstr = "server=47.109.31.237;port=3306;user=KxsMainServer2;password=FrW8ZfxlcaVdm1r0;database=KxsMainServer2;charset=utf8;";
+        //     DateTime start = DateTime.Parse(m + "-01 00:00:00");
+        //     DateTime end = start.AddMonths(1);
+        //     decimal ProfitAmt = 0;
+        //     while(start < end)
+        //     {
+        //         DateTime endDay = start.AddDays(1);
+        //         DataTable dt = OtherMySqlConn.dtable("select sum(HelpDirectTradeAmt) as HelpDirectTradeAmt,sum(NotHelpDirectTradeAmt) as NotHelpDirectTradeAmt from TradeDaySummary where UserId=" + uid + " and TradeDate='" + start.ToString("yyyyMMdd") + "' and SeoTitle='self' and BrandId=" + bid);
+        //         if(dt.Rows.Count > 0)
+        //         {
+        //             decimal HelpDirectTradeAmt = decimal.Parse(function.CheckNum(dt.Rows[0]["HelpDirectTradeAmt"].ToString()));
+        //             decimal NotHelpDirectTradeAmt = decimal.Parse(function.CheckNum(dt.Rows[0]["NotHelpDirectTradeAmt"].ToString()));
+        //             result += "扶持期:" + HelpDirectTradeAmt + ",稳定期:" + NotHelpDirectTradeAmt + ";\n";
+        //             dt = OtherMySqlConn.dtable("select sum(if(MerHelpFlag=1,TradeAmount,0)) as HelpAmt,sum(if(MerHelpFlag=0,TradeAmount,0)) as NotHelpAmt from TradeRecord where CreateDate>='" + start.ToString("yyyy-MM-dd HH:mm:ss") + "' and CreateDate<'" + endDay.ToString("yyyy-MM-dd HH:mm:ss") + "' and UserId=" + uid + " and BrandId=" + bid);
+        //             if(dt.Rows.Count > 0)
+        //             {
+        //                 decimal HelpAmt = decimal.Parse(function.CheckNum(dt.Rows[0]["HelpAmt"].ToString()));
+        //                 decimal NotHelpAmt = decimal.Parse(function.CheckNum(dt.Rows[0]["NotHelpAmt"].ToString()));
+        //                 result += "update TradeDaySummary set HelpDirectTradeAmt=" + HelpAmt + ",NotHelpDirectTradeAmt=" + NotHelpAmt + " where UserId=" + uid + " and TradeDate='" + start.ToString("yyyyMMdd") + "' and SeoTitle='self' and BrandId=" + bid + ";\n\n";
+        //                 dt = OtherMySqlConn.dtable("select UserLevel from Users where Id=" + uid + "");
+        //                 if(dt.Rows.Count > 0)
+        //                 {
+        //                     int UserLevel = int.Parse(function.CheckInt(dt.Rows[0]["UserLevel"].ToString()));
+        //                     dt = OtherMySqlConn.dtable("select Rank from UserRankWhite where Id=" + uid + "");
+        //                     if(dt.Rows.Count > 0)
+        //                     {
+        //                         UserLevel = int.Parse(function.CheckInt(dt.Rows[0]["Rank"].ToString()));
+        //                     }
+        //                     int LevelKindId = ProfitHelperV2.Instance.GetLevelKindId(bid, 1, 1);
+        //                     ProfitObjectLevels objlevel = RedisDbconn.Instance.Get<ProfitObjectLevels>("pobjlv" + LevelKindId + ":" + UserLevel) ?? new ProfitObjectLevels();
+        //                     ProfitAmt += HelpAmt * objlevel.Percents;
+        //                     LevelKindId = ProfitHelperV2.Instance.GetLevelKindId(bid, 0, 1);
+        //                     objlevel = RedisDbconn.Instance.Get<ProfitObjectLevels>("pobjlv" + LevelKindId + ":" + UserLevel) ?? new ProfitObjectLevels();
+        //                     ProfitAmt += NotHelpAmt * objlevel.Percents;
+        //                 }
+        //             }
+        //         }
+        //         start = start.AddDays(1);
+        //     }
+        //     DataTable dt2 = OtherMySqlConn.dtable("select Id,ProfitAmount from ProfitRecord where UserId=" + uid + " and SeoTitle='" + m.Replace("-", "") + "' and DirectFlag=1 and BrandId=" + bid);
+        //     if(dt2.Rows.Count > 0)
+        //     {
+        //         int Id = int.Parse(function.CheckInt(dt2.Rows[0]["Id"].ToString()));
+        //         decimal ProfitAmount = decimal.Parse(function.CheckNum(dt2.Rows[0]["ProfitAmount"].ToString()));
+        //         result += "当前分润:" + ProfitAmount + ";\n";
+        //         if(ProfitAmount != ProfitAmt)
+        //         {
+        //             result += "update ProfitRecord set ProfitAmount=" + ProfitAmt + " where UserId=" + uid + " and SeoTitle='" + m.Replace("-", "") + "' and DirectFlag=1 and BrandId=" + bid + ";\n";
+        //         }
+        //     }
+        //     OtherMySqlConn.connstr = "";
+        //     return result;
+        // }
     }
 }

+ 2 - 2
Startup.cs

@@ -90,7 +90,7 @@ namespace MySystem
             // services.AddHostedService<PopService>();
             // services.AddHostedService<SycnSpTimer>(); //同步SP数据
 
-            services.AddHostedService<TimerStatTimer>(); //实时统计创客、激活商户数
+            // services.AddHostedService<TimerStatTimer>(); //实时统计创客、激活商户数
             services.AddHostedService<PosTradeStatTimer>(); // 统计头天的交易额、商户型创客、激活奖励、开机奖励
             services.AddHostedService<AlipayPayBack2Timer>(); //支付宝回调处理
 
@@ -216,7 +216,7 @@ namespace MySystem
             // StatService.Instance.StartEverDay("");
             // StatService.Instance.StartEverDayV2();
             // RedPackageHelper.Instance.Start();
-            // StatService.Instance.StatUserLevel();
+            StatService.Instance.StatUserLevel();
             // ProfitHelperV2.Instance.StatProfit(); //统计分润
             // StatService.Instance.ListenFluxRecord();
             // StatService.Instance.StartEverDay2();