|
@@ -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() + "\"}");
|
|
|
// }
|
|
|
|
|
|
- // 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();
|
|
|
// foreach(var pos in poslist)
|
|
|
// {
|
|
@@ -238,48 +238,53 @@ namespace MySystem.Controllers
|
|
|
// }
|
|
|
// }
|
|
|
// }
|
|
|
-
|
|
|
- // Orders order = db.Orders.FirstOrDefault(m => m.Id == 357754);
|
|
|
- // if(order != null)
|
|
|
- // {
|
|
|
- // Users user = db.Users.FirstOrDefault(m => m.Id == order.UserId) ?? new Users();
|
|
|
- // int ParentUserId = user.ParentUserId;
|
|
|
- // bool buyPrize = false;
|
|
|
- // bool OncePrizeFlag4 = true;
|
|
|
- // int leaderFlag = 0;
|
|
|
- // while (ParentUserId > 0)
|
|
|
- // {
|
|
|
- // Users puser = db.Users.FirstOrDefault(m => m.Id == ParentUserId) ?? new Users();
|
|
|
- // if (puser.LeaderLevel > 0)
|
|
|
- // {
|
|
|
- // UserAccount acccount = db.UserAccount.FirstOrDefault(m => m.Id == puser.Id) ?? new UserAccount();
|
|
|
- // if (acccount.LeaderReserve >= 400 * 1 && !buyPrize)
|
|
|
- // {
|
|
|
- // //购机奖励
|
|
|
- // AlipayPayBack2Service.Instance.OpAccount(db, order, puser.Id, 100, 1);
|
|
|
- // buyPrize = true;
|
|
|
- // }
|
|
|
-
|
|
|
- // if (acccount.LeaderReserve >= 400 * 1 && puser.LeaderLevel > leaderFlag && leaderFlag < 2 && OncePrizeFlag4)
|
|
|
- // {
|
|
|
- // //扣减备用金
|
|
|
- // AlipayPayBack2Service.Instance.OpReserve(db, order, puser.Id, 400 * 1, 2, order.UserId, "购机奖励");
|
|
|
- // //返回到余额
|
|
|
- // AlipayPayBack2Service.Instance.OpLeaderAccount(db, order, puser.Id, 400, 1);
|
|
|
- // 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();
|
|
|
+
|
|
|
+ List<string> ordernos = new List<string>();
|
|
|
+ ordernos.Add("BM2023113022512846454132568");
|
|
|
+ foreach(string orderno in ordernos)
|
|
|
+ {
|
|
|
+ Orders order = db.Orders.FirstOrDefault(m => m.OrderNo == orderno);
|
|
|
+ if(order != null)
|
|
|
+ {
|
|
|
+ Users user = db.Users.FirstOrDefault(m => m.Id == order.UserId) ?? new Users();
|
|
|
+ int ParentUserId = user.ParentUserId;
|
|
|
+ bool buyPrize = false;
|
|
|
+ bool OncePrizeFlag4 = true;
|
|
|
+ int leaderFlag = 0;
|
|
|
+ while (ParentUserId > 0)
|
|
|
+ {
|
|
|
+ Users puser = db.Users.FirstOrDefault(m => m.Id == ParentUserId) ?? new Users();
|
|
|
+ if (puser.LeaderLevel > 0)
|
|
|
+ {
|
|
|
+ UserAccount acccount = db.UserAccount.FirstOrDefault(m => m.Id == puser.Id) ?? new UserAccount();
|
|
|
+ if (acccount.LeaderReserve >= 400 * 1 && !buyPrize)
|
|
|
+ {
|
|
|
+ //购机奖励
|
|
|
+ AlipayPayBack2Service.Instance.OpAccount(db, order, puser.Id, 100, 1);
|
|
|
+ buyPrize = true;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (acccount.LeaderReserve >= 400 * 1 && puser.LeaderLevel > leaderFlag && leaderFlag < 2 && OncePrizeFlag4)
|
|
|
+ {
|
|
|
+ //扣减备用金
|
|
|
+ AlipayPayBack2Service.Instance.OpReserve(db, order, puser.Id, 400 * 1, 2, order.UserId, "购机奖励");
|
|
|
+ //返回到余额
|
|
|
+ AlipayPayBack2Service.Instance.OpLeaderAccount(db, order, puser.Id, 400, 1);
|
|
|
+ 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();
|
|
|
|
|
|
return result;
|
|
|
}
|