|
@@ -914,6 +914,50 @@ namespace MySystem
|
|
Utils.Instance.PrizePush(GetUserId, ActPrize);
|
|
Utils.Instance.PrizePush(GetUserId, ActPrize);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ public void doPrizeFunc(WebCMSEntities db, PosMerchantInfo merchant, PosMachinesTwo pos, int GetUserId, string ParentNav, int TopUserId, decimal ActPrize, int ChangeType = 0, int ActType = 0)
|
|
|
|
+ {
|
|
|
|
+ Users machineUser = db.Users.FirstOrDefault(m => m.Id == pos.BuyUserId) ?? new Users();
|
|
|
|
+ UserAccount account = db.UserAccount.FirstOrDefault(m => m.Id == GetUserId);
|
|
|
|
+ if (account == null)
|
|
|
|
+ {
|
|
|
|
+ account = db.UserAccount.Add(new UserAccount()
|
|
|
|
+ {
|
|
|
|
+ Id = GetUserId,
|
|
|
|
+ UserId = GetUserId,
|
|
|
|
+ }).Entity;
|
|
|
|
+ db.SaveChanges();
|
|
|
|
+ }
|
|
|
|
+ decimal BeforeTotalAmount = account.TotalAmount; //变更前总金额
|
|
|
|
+ decimal BeforeFreezeAmount = account.FreezeAmount; //变更前冻结金额
|
|
|
|
+ decimal BeforeBalanceAmount = account.BalanceAmount; //变更前余额
|
|
|
|
+ account.BalanceAmount += ActPrize;
|
|
|
|
+ account.TotalAmount += ActPrize;
|
|
|
|
+ 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 = GetUserId, //创客
|
|
|
|
+ ChangeType = ChangeType, //变动类型
|
|
|
|
+ ProductType = pos.BrandId, //产品类型
|
|
|
|
+ ChangeAmount = ActPrize, //变更金额
|
|
|
|
+ BeforeTotalAmount = BeforeTotalAmount, //变更前总金额
|
|
|
|
+ AfterTotalAmount = AfterTotalAmount, //变更后总金额
|
|
|
|
+ BeforeFreezeAmount = BeforeFreezeAmount, //变更前冻结金额
|
|
|
|
+ AfterFreezeAmount = AfterFreezeAmount, //变更后冻结金额
|
|
|
|
+ BeforeBalanceAmount = BeforeBalanceAmount, //变更前余额
|
|
|
|
+ AfterBalanceAmount = AfterBalanceAmount, //变更后余额
|
|
|
|
+ QueryCount = pos.Id, //机具Id
|
|
|
|
+ Kind = 3
|
|
|
|
+ }).Entity;
|
|
|
|
+ db.SaveChanges();
|
|
|
|
+
|
|
|
|
+ //发送APP推送消息
|
|
|
|
+ Utils.Instance.PrizePush(GetUserId, ActPrize);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
|
|
//根据商户信息发放激活奖励
|
|
//根据商户信息发放激活奖励
|
|
public void dosomething32(int merid = 0)
|
|
public void dosomething32(int merid = 0)
|