Browse Source

调整推荐王逻辑

lcl 9 tháng trước cách đây
mục cha
commit
175b7356b6
1 tập tin đã thay đổi với 4 bổ sung37 xóa
  1. 4 37
      AppStart/Helper/RecommandKingHelper.cs

+ 4 - 37
AppStart/Helper/RecommandKingHelper.cs

@@ -44,52 +44,20 @@ namespace MySystem
             }
             function.WritePage("/RecommandKing/", today + ".txt", DateTime.Now.ToString());
             List<int> ReduceUserId = new List<int>();
+            WebCMSEntities db = new WebCMSEntities();
             List<RecommendDirectUser> list = new List<RecommendDirectUser>();
-            List<int> Historys = new List<int>();
+            string TradeMonth = DateTime.Now.AddMonths(-0).ToString("yyyyMM");
+            List<int> Historys = db.RecommendDirectUser.Where(m => m.QueryCount >= 50 && m.TradeMonth != TradeMonth).ToList().Select(m => m.UserId).ToList();
             Historys.Add(565);
             Historys.Add(139473);
             Historys.Add(173790);
             Historys.Add(174506);
             Historys.Add(127023);
-            Historys.Add(582);
-            Historys.Add(588);
-            Historys.Add(609);
-            Historys.Add(730);
-            Historys.Add(1421);
-            Historys.Add(71648);
-            Historys.Add(133571);
-            Historys.Add(146503);
-            Historys.Add(168578);
-            Historys.Add(173793);
-            Historys.Add(176218);
-            Historys.Add(182658);
-            Historys.Add(193048);
-            Historys.Add(195205);
-            Historys.Add(195002);
-            Historys.Add(205459);
-            Historys.Add(198621);
-            Historys.Add(197509);
-            Historys.Add(202230);
-            Historys.Add(205490);
-            Historys.Add(193837);
-            Historys.Add(195612);
-            Historys.Add(193350);
-            Historys.Add(164983);
-            Historys.Add(176444);
-            Historys.Add(141621);
-            Historys.Add(10618);
-            Historys.Add(134503);
-            Historys.Add(168546);
-            Historys.Add(149335);
-            Historys.Add(415);
-            Historys.Add(218);
-            string TradeMonth = DateTime.Now.AddMonths(-0).ToString("yyyyMM");
             DateTime check = DateTime.Parse("2023-10-01 00:00:00");
-            // DateTime checke = DateTime.Parse("2024-04-29 00:00:00");
             DateTime start = DateTime.Parse(DateTime.Now.AddMonths(-0).ToString("yyyy-MM") + "-01 00:00:00");
             DateTime end = start.AddMonths(1);
             CustomerSqlConn.op("delete from RecommendDirectUser where TradeMonth='" + TradeMonth + "'", MysqlConn.SqlConnStr);
-            string PreTradeMonth = DateTime.Now.AddMonths(-1).ToString("yyyyMM");
+            string PreTradeMonth = DateTime.Now.AddMonths(-0).ToString("yyyyMM");
             List<int> ProductIds = new List<int>();
             ProductIds.Add(10);
             ProductIds.Add(11);
@@ -102,7 +70,6 @@ namespace MySystem
             ProductIds.Add(40);
             List<RecommandKingItem> users = new List<RecommandKingItem>();
             // Dictionary<int, decimal> PreMonthAmt = GetTradeAmtList(PreTradeMonth);
-            WebCMSEntities db = new WebCMSEntities();
             ReadModels.WebCMSEntities readdb = new ReadModels.WebCMSEntities();
             MpMainModels.WebCMSEntities mpdb = new MpMainModels.WebCMSEntities();
             MpMainModels2.WebCMSEntities mpdb2 = new MpMainModels2.WebCMSEntities();