|
@@ -171,6 +171,52 @@ namespace MySystem
|
|
|
}
|
|
|
if(parentUser.OperateLevel == 2 && CurBuyPrize == 100) BuyPrizeFlag = 2;
|
|
|
}
|
|
|
+ else if(parentUser.OperateLevel > 0 && CheckOpReserve(opdb, order.BuyCount, parentUser.Id) && BuyPrizeFlag < 2)
|
|
|
+ {
|
|
|
+ Utils.Instance.PrizeRecord(2, order.OrderNo, "满足条件,发放购机奖");
|
|
|
+ //购机奖
|
|
|
+ decimal CurBuyPrize = GetBuyPrize(parentUser, order.UserId);
|
|
|
+ decimal GetPrize = CurBuyPrize - BuyPrize;
|
|
|
+ Utils.Instance.PrizeRecord(2, order.OrderNo, "发放金额:" + GetPrize);
|
|
|
+ if(GetPrize > 0)
|
|
|
+ {
|
|
|
+ int ChangeType = 120;
|
|
|
+ if(parentUser.OperateLevel > 1)
|
|
|
+ {
|
|
|
+ ChangeType = 128;
|
|
|
+ }
|
|
|
+ OpAccount(db, order.Id, parentUser.Id, GetPrize, order.BuyCount, ChangeType);
|
|
|
+ BuyPrize = CurBuyPrize;
|
|
|
+ if(GetPrize == 160) BuyPrizeFlag = 2;
|
|
|
+ else if(GetPrize == 60) BuyPrizeFlag = 2;
|
|
|
+ else BuyPrizeFlag = 1;
|
|
|
+ }
|
|
|
+ if(parentUser.OperateLevel == 2 && CurBuyPrize == 100) BuyPrizeFlag = 2;
|
|
|
+
|
|
|
+ if(!BackAccountFlag)
|
|
|
+ {
|
|
|
+ BackAccountFlag = true;
|
|
|
+ decimal GetAmount = GetWithdrawMoney(parentUser) * order.BuyCount;
|
|
|
+ //扣减备用金
|
|
|
+ // OperateAmountChange(opdb, parentUser.Id, GetAmount, 2, 1, "商城购机", true, order.Id);
|
|
|
+ // //返回到余额
|
|
|
+ // OperateAmountChange(opdb, parentUser.Id, GetAmount, 1, 2, "商城购机", true, order.Id);
|
|
|
+
|
|
|
+ OpAmountItem item = new OpAmountItem()
|
|
|
+ {
|
|
|
+ UserId = parentUser.Id,
|
|
|
+ OperateType = 0,
|
|
|
+ ChangeType = 5,
|
|
|
+ Remark = "商城购机",
|
|
|
+ UseAmount = GetAmount,
|
|
|
+ UseValidForGetAmount = GetAmount,
|
|
|
+ UseTotalAmt = GetAmount,
|
|
|
+ DataType = 1,
|
|
|
+ DataId = order.Id,
|
|
|
+ };
|
|
|
+ RedisDbconn.Instance.AddList("OperateAmountRecordServiceQueue", item);
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
if(!BackAccountFlag)
|
|
|
{
|