Browse Source

推荐王条件变更

lcl 2 months ago
parent
commit
7c8c1822c0
1 changed files with 8 additions and 2 deletions
  1. 8 2
      AppStart/Helper/RecommandKingHelper.cs

+ 8 - 2
AppStart/Helper/RecommandKingHelper.cs

@@ -160,6 +160,7 @@ namespace MySystem
             }
 
             DateTime check = DateTime.Parse("2023-10-01 00:00:00");
+            DateTime checkEnd = DateTime.Parse(TradeMonth.Substring(0, 4) + "-" + TradeMonth.Substring(4, 2) + "-01 00:00:00").AddMonths(1);
             DateTime start = DateTime.Parse(TradeMonth.Substring(0, 4) + "-" + TradeMonth.Substring(4, 2) + "-01 00:00:00");
             DateTime end = start.AddMonths(1);
             CustomerSqlConn.op("delete from kxs_invite_king where trade_month='" + TradeMonth + "' and kind=" + Kind, MysqlConn.JavaUserSqlConnStr);
@@ -173,6 +174,7 @@ namespace MySystem
             ProductIds.Add(28);
             ProductIds.Add(39);
             ProductIds.Add(40);
+            ProductIds.Add(92);
             List<RecommandKingItem> users = new List<RecommandKingItem>();
             JavaStatModels.WebCMSEntities statdb = new JavaStatModels.WebCMSEntities();
             JavaProductModels.WebCMSEntities productdb = new JavaProductModels.WebCMSEntities();
@@ -180,7 +182,11 @@ namespace MySystem
             MpMainModels2.WebCMSEntities mpdb2 = new MpMainModels2.WebCMSEntities();
             //统计当月下单名单
             var orderids = productdb.KxsShopOrderInfo.Where(m => ProductIds.Contains(m.GoodsId)).ToList().Select(m => m.OrderId).ToList();
-            var orders = productdb.KxsShopOrder.Where(m => m.PayTime >= check && m.Status > 0 && m.UserId > 1 && orderids.Contains(m.Id)).ToList();
+            List<int> statusList = new List<int>();
+            statusList.Add(1);
+            statusList.Add(2);
+            statusList.Add(3);
+            var orders = productdb.KxsShopOrder.Where(m => m.PayTime >= check && m.PayTime < checkEnd && statusList.Contains(m.Status) && m.UserId > 1 && orderids.Contains(m.Id) && m.ReturnStatus == 0).ToList();
             function.WriteLog("kind:" + Kind + "--" + orders.Count.ToString(), "推荐王日志");
             List<int> uids = orders.Select(m => m.UserId).Distinct().ToList();
             foreach(int uid in uids)
@@ -227,7 +233,7 @@ namespace MySystem
                 if(ActCount > 0)
                 {
                     user.Op = true;
-                    function.WriteLog("有效标记-kind:" + Kind + "--" + user.UserId.ToString(), "推荐王日志");
+                    function.WriteLog("有效标记-kind:" + Kind + "--" + user.ParentNav.ToString() + "->" + user.UserId.ToString(), "推荐王日志");
                 }
             }
             foreach(int uid in uids)