|
@@ -169,7 +169,7 @@ namespace MySystem
|
|
|
else if(parentUser.OperateLevel > 0 && CheckOpReserve(opdb, order.BuyCount, parentUser.Id))
|
|
|
{
|
|
|
//购机奖
|
|
|
- decimal CurBuyPrize = GetBuyPrize(parentUser);
|
|
|
+ decimal CurBuyPrize = GetBuyPrize(parentUser, order.UserId);
|
|
|
decimal GetPrize = CurBuyPrize - BuyPrize;
|
|
|
if(GetPrize > 0)
|
|
|
{
|
|
@@ -350,7 +350,7 @@ namespace MySystem
|
|
|
else if(parentUser.OperateLevel > 0 && CheckOpReserve(opdb, order.BuyCount, parentUser.Id))
|
|
|
{
|
|
|
//购机奖
|
|
|
- decimal CurBuyPrize = GetBuyPrize(parentUser);
|
|
|
+ decimal CurBuyPrize = GetBuyPrize(parentUser, order.UserId);
|
|
|
decimal GetPrize = CurBuyPrize - BuyPrize;
|
|
|
if(GetPrize > 0)
|
|
|
{
|
|
@@ -783,12 +783,12 @@ namespace MySystem
|
|
|
/// </summary>
|
|
|
/// <param name="user"></param>
|
|
|
/// <returns></returns>
|
|
|
- public decimal GetBuyPrize(UserRankItem user)
|
|
|
+ public decimal GetBuyPrize(UserRankItem user, int OrderUserId = 0)
|
|
|
{
|
|
|
if(user.OperateLevel == 1) return 100;
|
|
|
if(user.OperateLevel == 2)
|
|
|
{
|
|
|
- if(!TradeTeamCheck(user.Id))
|
|
|
+ if(!TradeTeamCheck(OrderUserId))
|
|
|
{
|
|
|
return 100;
|
|
|
}
|
|
@@ -803,8 +803,21 @@ namespace MySystem
|
|
|
public bool TradeTeamCheck(int UserId)
|
|
|
{
|
|
|
bool op = true;
|
|
|
+ if(UserId == 0)
|
|
|
+ {
|
|
|
+ return op;
|
|
|
+ }
|
|
|
+ WebCMSEntities maindb = new WebCMSEntities();
|
|
|
+ Users muser = maindb.Users.FirstOrDefault(m => m.Id == UserId) ?? new Users();
|
|
|
+ string ParentNav = muser.ParentNav + "," + UserId + ",";
|
|
|
+ string[] ParentNavList = ParentNav.Replace(",,", ",").Trim(',').Split(',');
|
|
|
+ List<int> UserIds = new List<int>();
|
|
|
+ foreach(string IdString in ParentNavList)
|
|
|
+ {
|
|
|
+ UserIds.Add(int.Parse(function.CheckInt(IdString)));
|
|
|
+ }
|
|
|
JavaModels.WebCMSEntities db = new JavaModels.WebCMSEntities();
|
|
|
- JavaModels.KxsCampUser user = db.KxsCampUser.FirstOrDefault(m => m.UserId == UserId);
|
|
|
+ JavaModels.KxsCampUser user = db.KxsCampUser.FirstOrDefault(m => UserIds.Contains(m.UserId));
|
|
|
if(user != null)
|
|
|
{
|
|
|
DateTime now = DateTime.Now;
|
|
@@ -814,6 +827,7 @@ namespace MySystem
|
|
|
op = false;
|
|
|
}
|
|
|
}
|
|
|
+ maindb.Dispose();
|
|
|
db.Dispose();
|
|
|
return op;
|
|
|
}
|