|
@@ -2199,6 +2199,12 @@ namespace MySystem
|
|
UserLevel = rank.Rank;
|
|
UserLevel = rank.Rank;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ if(level == 1)
|
|
|
|
+ {
|
|
|
|
+ function.WriteLog(user.MakerCode, "分润补贴日志");
|
|
|
|
+ function.WriteLog(user.UserLevel.ToString(), "分润补贴日志");
|
|
|
|
+ function.WriteLog(pos.PosSn, "分润补贴日志");
|
|
|
|
+ }
|
|
if (UserLevel == maxLevel && UserLevel == curLevel) //判断当前创客是否有直推的激活机具,并且在活动时间内
|
|
if (UserLevel == maxLevel && UserLevel == curLevel) //判断当前创客是否有直推的激活机具,并且在活动时间内
|
|
{
|
|
{
|
|
break;
|
|
break;
|
|
@@ -2210,6 +2216,7 @@ namespace MySystem
|
|
{
|
|
{
|
|
HelpTime = 1;
|
|
HelpTime = 1;
|
|
}
|
|
}
|
|
|
|
+ function.WriteLog("HelpTime:" + HelpTime, "分润补贴日志");
|
|
int LevelKindId = GetLevelKindId(BrandId, HelpTime, 1);
|
|
int LevelKindId = GetLevelKindId(BrandId, HelpTime, 1);
|
|
ProfitObjectLevels objlevel = RedisDbconn.Instance.Get<ProfitObjectLevels>("pobjlv" + LevelKindId + ":" + UserLevel); //获取当前等级参数
|
|
ProfitObjectLevels objlevel = RedisDbconn.Instance.Get<ProfitObjectLevels>("pobjlv" + LevelKindId + ":" + UserLevel); //获取当前等级参数
|
|
if (objlevel != null)
|
|
if (objlevel != null)
|
|
@@ -2254,29 +2261,52 @@ namespace MySystem
|
|
//分润补贴
|
|
//分润补贴
|
|
if (HelpTime == 1 && level == 1)
|
|
if (HelpTime == 1 && level == 1)
|
|
{
|
|
{
|
|
|
|
+ function.WriteLog("满足条件", "分润补贴日志");
|
|
int SubsidyUserId = pos.BuyUserId;
|
|
int SubsidyUserId = pos.BuyUserId;
|
|
Users subuser = dbnew.Users.FirstOrDefault(m => m.Id == SubsidyUserId) ?? new Users();
|
|
Users subuser = dbnew.Users.FirstOrDefault(m => m.Id == SubsidyUserId) ?? new Users();
|
|
- decimal otherPercent = 0.001M - objlevel.Percents;
|
|
|
|
- decimal otherMoney = TradeAmt * otherPercent;
|
|
|
|
- if (otherMoney >= obj.MinProfitVal)
|
|
|
|
|
|
+ int subUserLevel = subuser.UserLevel;
|
|
|
|
+ if(subUserLevel < 5)
|
|
{
|
|
{
|
|
- result.Add(new ProfitResult()
|
|
|
|
|
|
+ function.WriteLog("1:" + subUserLevel, "分润补贴日志");
|
|
|
|
+ UserRankWhite subrank = dbnew.UserRankWhite.FirstOrDefault(m => m.Id == subuser.Id && m.UpdateDate > now);
|
|
|
|
+ if (subrank != null)
|
|
|
|
+ {
|
|
|
|
+ if (subrank.Rank > subUserLevel)
|
|
|
|
+ {
|
|
|
|
+ subUserLevel = subrank.Rank;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ if(subUserLevel < 5)
|
|
{
|
|
{
|
|
- UserId = subuser.Id,
|
|
|
|
- UserNav = subuser.ParentNav,
|
|
|
|
- Money = PublicFunction.NumberFormat(otherMoney),
|
|
|
|
- ProfitRate = otherPercent,
|
|
|
|
- Message = "分润补贴",
|
|
|
|
- BankCardType = BankCardType,
|
|
|
|
- QrPayFlag = QrPayFlag,
|
|
|
|
- DirectFlag = 1,
|
|
|
|
- BrandId = pos.BrandId,
|
|
|
|
- IsSubsidy = 1,
|
|
|
|
- MerchantId = pos.BindMerchantId,
|
|
|
|
- TradeAmount = TradeAmt,
|
|
|
|
- HelpFlag = HelpTime,
|
|
|
|
- PosSn = pos.PosSn,
|
|
|
|
- });
|
|
|
|
|
|
+ function.WriteLog("2:" + subUserLevel, "分润补贴日志");
|
|
|
|
+ ProfitObjectLevels sublevel = RedisDbconn.Instance.Get<ProfitObjectLevels>("pobjlv" + LevelKindId + ":" + subUserLevel); //获取当前等级参数
|
|
|
|
+ if (sublevel != null)
|
|
|
|
+ {
|
|
|
|
+ function.WriteLog("3:" + sublevel.Percents, "分润补贴日志");
|
|
|
|
+ decimal otherPercent = 0.001M - sublevel.Percents;
|
|
|
|
+ decimal otherMoney = TradeAmt * otherPercent;
|
|
|
|
+ if (otherMoney >= obj.MinProfitVal)
|
|
|
|
+ {
|
|
|
|
+ result.Add(new ProfitResult()
|
|
|
|
+ {
|
|
|
|
+ UserId = subuser.Id,
|
|
|
|
+ UserNav = subuser.ParentNav,
|
|
|
|
+ Money = PublicFunction.NumberFormat(otherMoney),
|
|
|
|
+ ProfitRate = otherPercent,
|
|
|
|
+ Message = "分润补贴",
|
|
|
|
+ BankCardType = BankCardType,
|
|
|
|
+ QrPayFlag = QrPayFlag,
|
|
|
|
+ DirectFlag = 1,
|
|
|
|
+ BrandId = pos.BrandId,
|
|
|
|
+ IsSubsidy = 1,
|
|
|
|
+ MerchantId = pos.BindMerchantId,
|
|
|
|
+ TradeAmount = TradeAmt,
|
|
|
|
+ HelpFlag = HelpTime,
|
|
|
|
+ PosSn = pos.PosSn,
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|