|
@@ -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,
|