|
@@ -223,7 +223,7 @@ namespace MySystem.Controllers
|
|
// RedisDbconn.Instance.AddList("SetDepositPostQueue", "{\"RecordId\":\"\",\"PosId\":\"" + dr["Id"].ToString() + "\",\"Fee\": \"0.6\",\"Kind\": \"2\",\"OpMan\": \"" + dr["DownFeeMan"].ToString() + "\"}");
|
|
// RedisDbconn.Instance.AddList("SetDepositPostQueue", "{\"RecordId\":\"\",\"PosId\":\"" + dr["Id"].ToString() + "\",\"Fee\": \"0.6\",\"Kind\": \"2\",\"OpMan\": \"" + dr["DownFeeMan"].ToString() + "\"}");
|
|
// }
|
|
// }
|
|
|
|
|
|
- WebCMSEntities db = new WebCMSEntities();
|
|
|
|
|
|
+ // WebCMSEntities db = new WebCMSEntities();
|
|
// var poslist = db.PosMachinesTwo.Select(m => new { m.Id, m.BrandId, m.CardType, m.IsPurchase, m.PosSn }).Where(m => m.BrandId == 14 && m.CardType == 2 && m.IsPurchase == 1).ToList();
|
|
// var poslist = db.PosMachinesTwo.Select(m => new { m.Id, m.BrandId, m.CardType, m.IsPurchase, m.PosSn }).Where(m => m.BrandId == 14 && m.CardType == 2 && m.IsPurchase == 1).ToList();
|
|
// foreach(var pos in poslist)
|
|
// foreach(var pos in poslist)
|
|
// {
|
|
// {
|
|
@@ -238,104 +238,7 @@ namespace MySystem.Controllers
|
|
// }
|
|
// }
|
|
// }
|
|
// }
|
|
// }
|
|
// }
|
|
-
|
|
|
|
- List<int> ids = new List<int>();
|
|
|
|
- ids.Add(10);
|
|
|
|
- ids.Add(11);
|
|
|
|
- ids.Add(77);
|
|
|
|
- ids.Add(78);
|
|
|
|
- ids.Add(79);
|
|
|
|
- DateTime Start = DateTime.Parse("2023-12-10 00:00:00");
|
|
|
|
- List<Orders> orders = db.Orders.Where(m => m.Status > 0 && m.CreateDate >= Start && ids.Contains(m.ProductId)).ToList();
|
|
|
|
- foreach(Orders order in orders)
|
|
|
|
- {
|
|
|
|
- OrderProduct pro = db.OrderProduct.FirstOrDefault(m => m.OrderId == order.Id) ?? new OrderProduct();
|
|
|
|
- Users user = db.Users.FirstOrDefault(m => m.Id == order.UserId) ?? new Users();
|
|
|
|
- List<int> prizeChk = new List<int>();
|
|
|
|
- if(!db.UserAccountRecord.Any(m => m.ChangeType == 112 && m.QueryCount == order.Id))
|
|
|
|
- {
|
|
|
|
- prizeChk.Add(1);
|
|
|
|
- }
|
|
|
|
- if(!db.UserAccountRecord.Any(m => m.ChangeType == 118 && m.QueryCount == order.Id))
|
|
|
|
- {
|
|
|
|
- prizeChk.Add(2);
|
|
|
|
- }
|
|
|
|
- if(!db.LeaderAccountRecord.Any(m => m.QueryCount == order.Id))
|
|
|
|
- {
|
|
|
|
- prizeChk.Add(3);
|
|
|
|
- }
|
|
|
|
- int ParentUserId = user.ParentUserId;
|
|
|
|
- bool buyPrize = false;
|
|
|
|
- bool OncePrizeFlag4 = true;
|
|
|
|
- int leaderFlag = 0;
|
|
|
|
- bool DirectPrizeFlag = true;
|
|
|
|
- if(user.LeaderLevel > 0 || user.UserType == 1) //盟主或运营中心
|
|
|
|
- {
|
|
|
|
- //推荐奖励
|
|
|
|
- if(prizeChk.Contains(1))
|
|
|
|
- {
|
|
|
|
- AlipayPayBack2Service.Instance.DirectPrize(db, order.Id, order.UserId, pro.ProductCount);
|
|
|
|
- }
|
|
|
|
- DirectPrizeFlag = false;
|
|
|
|
- UserAccount acccount = db.UserAccount.FirstOrDefault(m => m.Id == order.UserId) ?? new UserAccount();
|
|
|
|
- if (acccount.LeaderReserve >= 400 * pro.ProductCount && !buyPrize)
|
|
|
|
- {
|
|
|
|
- //购机奖励
|
|
|
|
- if(prizeChk.Contains(2))
|
|
|
|
- {
|
|
|
|
- AlipayPayBack2Service.Instance.OpAccount(db, order, order.UserId, 100, 1);
|
|
|
|
- }
|
|
|
|
- buyPrize = true;
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- while (ParentUserId > 0)
|
|
|
|
- {
|
|
|
|
- Users puser = db.Users.FirstOrDefault(m => m.Id == ParentUserId) ?? new Users();
|
|
|
|
- if(DirectPrizeFlag)
|
|
|
|
- {
|
|
|
|
- if(prizeChk.Contains(1))
|
|
|
|
- {
|
|
|
|
- AlipayPayBack2Service.Instance.DirectPrize(db, order.Id, ParentUserId, pro.ProductCount);
|
|
|
|
- }
|
|
|
|
- DirectPrizeFlag = false;
|
|
|
|
- }
|
|
|
|
- if (puser.LeaderLevel > 0)
|
|
|
|
- {
|
|
|
|
- UserAccount acccount = db.UserAccount.FirstOrDefault(m => m.Id == puser.Id) ?? new UserAccount();
|
|
|
|
- if (acccount.LeaderReserve >= 400 * pro.ProductCount && !buyPrize)
|
|
|
|
- {
|
|
|
|
- //购机奖励
|
|
|
|
- if(prizeChk.Contains(2))
|
|
|
|
- {
|
|
|
|
- AlipayPayBack2Service.Instance.OpAccount(db, order, puser.Id, 100, 1);
|
|
|
|
- }
|
|
|
|
- buyPrize = true;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- if (acccount.LeaderReserve >= 400 * pro.ProductCount && puser.LeaderLevel > leaderFlag && leaderFlag < 2 && OncePrizeFlag4)
|
|
|
|
- {
|
|
|
|
- if(prizeChk.Contains(3))
|
|
|
|
- {
|
|
|
|
- //扣减备用金
|
|
|
|
- AlipayPayBack2Service.Instance.OpReserve(db, order, puser.Id, 400 * pro.ProductCount, 2, order.UserId, "购机奖励");
|
|
|
|
- //返回到余额
|
|
|
|
- AlipayPayBack2Service.Instance.OpLeaderAccount(db, order, puser.Id, 400, pro.ProductCount);
|
|
|
|
- }
|
|
|
|
- leaderFlag = puser.LeaderLevel;
|
|
|
|
- OncePrizeFlag4 = false;
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- ParentUserId = puser.ParentUserId;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- //购买盟主奖励
|
|
|
|
- // decimal Prize = decimal.Parse(function.CheckNum(PublicFunction.GetPublicParam(db, "BigLeaderPrize")));
|
|
|
|
- // if(Prize > 0)
|
|
|
|
- // {
|
|
|
|
- // AlipayPayBack2Service.Instance.LeaderRecommendPrize(db, order, 565, Prize, 122);
|
|
|
|
- // }
|
|
|
|
- }
|
|
|
|
- db.Dispose();
|
|
|
|
|
|
+ // db.Dispose();
|
|
|
|
|
|
return result;
|
|
return result;
|
|
}
|
|
}
|