|
@@ -429,6 +429,70 @@ namespace MySystem.Controllers
|
|
|
return "ok";
|
|
|
}
|
|
|
|
|
|
+ // public string add100()
|
|
|
+ // {
|
|
|
+ // WebCMSEntities db = new WebCMSEntities();
|
|
|
+ // List<int> uids = new List<int>();
|
|
|
+ // uids.Add(1053);
|
|
|
+ // foreach (int uid in uids)
|
|
|
+ // {
|
|
|
+ // int ParentUserId = uid;
|
|
|
+ // int machineCount = db.PosMachinesTwo.Count(m => m.UserId == ParentUserId && m.PosSnType == 0); //判断是否拥有3台购买机
|
|
|
+ // int ActiveCount = db.PosMachinesTwo.Count(m => m.UserId == ParentUserId && m.ActivationState == 1); //判断是否拥有3台激活机(不限购买或赠送)
|
|
|
+ // if (machineCount + ActiveCount >= 3)
|
|
|
+ // {
|
|
|
+ // UserAccount account = db.UserAccount.FirstOrDefault(m => m.Id == ParentUserId);
|
|
|
+ // if (account == null)
|
|
|
+ // {
|
|
|
+ // account = db.UserAccount.Add(new UserAccount()
|
|
|
+ // {
|
|
|
+ // Id = ParentUserId,
|
|
|
+ // UserId = ParentUserId,
|
|
|
+ // }).Entity;
|
|
|
+ // db.SaveChanges();
|
|
|
+ // }
|
|
|
+ // decimal BeforeTotalAmount = account.TotalAmount; //变更前总金额
|
|
|
+ // decimal BeforeFreezeAmount = account.FreezeAmount; //变更前冻结金额
|
|
|
+ // decimal BeforeBalanceAmount = account.BalanceAmount; //变更前余额
|
|
|
+ // account.BalanceAmount += 100;
|
|
|
+ // account.TotalAmount += 100;
|
|
|
+ // decimal AfterTotalAmount = account.TotalAmount; //变更后总金额
|
|
|
+ // decimal AfterFreezeAmount = account.FreezeAmount; //变更后冻结金额
|
|
|
+ // decimal AfterBalanceAmount = account.BalanceAmount; //变更后余额
|
|
|
+ // UserAccountRecord userAccountRecord = db.UserAccountRecord.Add(new UserAccountRecord()
|
|
|
+ // {
|
|
|
+ // CreateDate = DateTime.Now,
|
|
|
+ // UpdateDate = DateTime.Now,
|
|
|
+ // UserId = ParentUserId, //创客
|
|
|
+ // ChangeType = 112, //变动类型
|
|
|
+ // ChangeAmount = 100, //变更金额
|
|
|
+ // BeforeTotalAmount = BeforeTotalAmount, //变更前总金额
|
|
|
+ // AfterTotalAmount = AfterTotalAmount, //变更后总金额
|
|
|
+ // BeforeFreezeAmount = BeforeFreezeAmount, //变更前冻结金额
|
|
|
+ // AfterFreezeAmount = AfterFreezeAmount, //变更后冻结金额
|
|
|
+ // BeforeBalanceAmount = BeforeBalanceAmount, //变更前余额
|
|
|
+ // AfterBalanceAmount = AfterBalanceAmount, //变更后余额
|
|
|
+ // }).Entity;
|
|
|
+ // db.SaveChanges();
|
|
|
+ // RedisDbconn.Instance.Set("UserAccount:" + ParentUserId, account);
|
|
|
+
|
|
|
+ // //推荐下单上级获得30天的机具循环天数
|
|
|
+ // var posList = db.PosMachinesTwo.Select(m => new { m.Id, m.UserId, m.BindingState, m.RecycEndDate }).Where(m => m.UserId == ParentUserId && m.BindingState == 0 && m.RecycEndDate != null).ToList();
|
|
|
+ // foreach (var subPos in posList)
|
|
|
+ // {
|
|
|
+ // PosMachinesTwo pos = db.PosMachinesTwo.FirstOrDefault(m => m.Id == subPos.Id);
|
|
|
+ // if (pos != null)
|
|
|
+ // {
|
|
|
+ // pos.RecycEndDate = pos.RecycEndDate.Value.AddDays(30);
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // db.SaveChanges();
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // db.Dispose();
|
|
|
+ // return "finish";
|
|
|
+ // }
|
|
|
+
|
|
|
public string test()
|
|
|
{
|
|
|
// StatService.Instance.dosomething2("2022-03-31");
|