Parcourir la source

分润保存创客信息和顶级信息

lcl il y a 1 an
Parent
commit
ee22726900
2 fichiers modifiés avec 20 ajouts et 1 suppressions
  1. 2 0
      Entity/ProfitResult.cs
  2. 18 1
      Util/HaoDa/ProfitHelper.cs

+ 2 - 0
Entity/ProfitResult.cs

@@ -4,6 +4,8 @@ namespace MySystem
     public class ProfitResult
     {
         public int UserId { get; set; }
+        public string MakerCode { get; set; }
+        public string RealName { get; set; }
         public decimal Money { get; set; }
         public int MachineCount { get; set; }
         public string UserNav { get; set; }

+ 18 - 1
Util/HaoDa/ProfitHelper.cs

@@ -281,7 +281,15 @@ namespace MySystem
                     if (!string.IsNullOrEmpty(us.ParentNav))
                     {
                         uidstring = us.ParentNav.Trim(',').Replace(",,", ",") + "," + uidstring;
-                        TopUserId = int.Parse(function.CheckInt(us.ParentNav.Trim(',').Replace(",,", ",").Split(',')[0]));
+                        string[] parents = us.ParentNav.Trim(',').Replace(",,", ",").Split(',');
+                        if(parents.Length > 1)
+                        {
+                            TopUserId = int.Parse(function.CheckInt(parents[1]));
+                        }
+                        else
+                        {
+                            TopUserId = int.Parse(function.CheckInt(parents[0]));
+                        }
                     }
                     string[] uidlist = uidstring.Split(',');
                     Array.Reverse(uidlist);
@@ -294,6 +302,8 @@ namespace MySystem
                             users.Add(new ProfitUsers()
                             {
                                 UserId = pus.Id,
+                                MakerCode = pus.MakerCode,
+                                RealName = pus.RealName,
                                 UserNav = pus.ParentNav,
                                 UserLevel = pus.UserLevel,
                                 CreateDate = pus.CreateDate.Value,
@@ -301,6 +311,7 @@ namespace MySystem
                         }
                     }
                 }
+                Models.KxsMain.Users topUser = kxsdb.Users.FirstOrDefault(a => a.Id == TopUserId) ?? new Models.KxsMain.Users();
                 LogHelper.Instance.WriteLog("---UserId:" + UserId + ";TotalAmount:" + TotalAmount + ";", "来客吧分润日志");
                 List<ProfitResult> list = new List<ProfitResult>();
                 list = StartProft(TotalAmount, 1, users, IsActive);                
@@ -321,6 +332,10 @@ namespace MySystem
                                 ProfitType = ProfitType, //创客分润类型
                                 TradeMonth = TradeMonth, //交易月
                                 TopUserId = TopUserId, //顶级创客
+                                CreateMan = sub.MakerCode, //创客编号
+                                UpdateMan = topUser.MakerCode, //顶级编号
+                                SeoTitle = sub.RealName, //创客姓名
+                                SeoKeyword = topUser.RealName, //创客姓名
                             }).Entity;
                             dbnew.SaveChanges();
                             string RecordNo = "KPM";
@@ -422,6 +437,8 @@ namespace MySystem
                                 result.Add(new ProfitResult()
                                 {
                                     UserId = user.UserId,
+                                    MakerCode = user.MakerCode,
+                                    RealName = user.RealName,
                                     UserNav = user.UserNav,
                                     Money = PublicFunction.NumberFormat(getLevelProfit),
                                     ProfitRate = profitSet.ProfitRate,