|
@@ -259,7 +259,7 @@ namespace MySystem
|
|
|
{
|
|
|
Utils.Instance.PrizeRecord(2, order.OrderNo, "满足条件,发放购机奖");
|
|
|
//购机奖
|
|
|
- decimal CurBuyPrize = GetBuyPrize(parentUser, order.UserId);
|
|
|
+ decimal CurBuyPrize = GetBuyPrize(parentUser, order);
|
|
|
decimal GetPrize = CurBuyPrize - BuyPrize;
|
|
|
Utils.Instance.PrizeRecord(2, order.OrderNo, "发放金额:" + GetPrize);
|
|
|
if(GetPrize > 0)
|
|
@@ -301,6 +301,90 @@ namespace MySystem
|
|
|
RedisDbconn.Instance.AddList("OperateAmountRecordServiceQueue", item);
|
|
|
}
|
|
|
}
|
|
|
+<<<<<<< HEAD
|
|
|
+=======
|
|
|
+
|
|
|
+ if(!BackAccountFlag)
|
|
|
+ {
|
|
|
+ BackAccountFlag = true;
|
|
|
+ //扣减备用金
|
|
|
+ int ReserveRecordId = OpReserve(db, order.Id, parentUser.Id, GetWithdrawMoney(parentUser) * order.BuyCount, 2, order.UserId, "购机奖励");
|
|
|
+ //返回到余额
|
|
|
+ OpLeaderAccount(db, order, parentUser.Id, GetWithdrawMoney(parentUser), order.BuyCount, ReserveRecordId);
|
|
|
+ }
|
|
|
+
|
|
|
+ //给券打大盟主标记
|
|
|
+ Utils.Instance.PrizeRecord(2, order.OrderNo, "条件:创客是盟主;创客盟主等级:" + parentUser.LeaderLevel + "");
|
|
|
+ Utils.Instance.PrizeRecord(2, order.OrderNo, "条件:盟主储备金是否充足;");
|
|
|
+ if(parentUser.LeaderLevel == 1 && CheckLeaderReserve(db, order.BuyCount, parentUser.Id) && !BigLeaderFlag)
|
|
|
+ {
|
|
|
+ Utils.Instance.PrizeRecord(2, order.OrderNo, "满足小盟主条件,开始检查大盟主关联的额度");
|
|
|
+ int LeaderId = CheckPosCouponLeaderFlag(db, parentUser.Id, order.BuyCount, codes);
|
|
|
+ if(LeaderId > 0)
|
|
|
+ {
|
|
|
+ BigLeaderFlag = true;
|
|
|
+ Utils.Instance.PrizeRecord(2, order.OrderNo, "满足条件,大盟主标记打给" + LeaderId);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else if(parentUser.LeaderLevel == 2 && !BigLeaderFlag)
|
|
|
+ {
|
|
|
+ Utils.Instance.PrizeRecord(2, order.OrderNo, "满足大盟主条件,大盟主标记打给" + parentUser.Id + ",对应机具券:" + order.SnNos);
|
|
|
+ BigLeaderFlag = true;
|
|
|
+ if(!string.IsNullOrEmpty(order.SnNos))
|
|
|
+ {
|
|
|
+ List<int> couponIds = db.PosCoupons.Where(m => codes.Contains(m.ExchangeCode)).OrderBy(m => m.Id).Take(CouponCount).ToList().Select(m => m.Id).ToList();
|
|
|
+ Utils.Instance.PrizeRecord(2, order.OrderNo, "开始打标记,数量:" + couponIds.Count);
|
|
|
+ SetPosCouponLeaderFlag(db, parentUser.Id, order.BuyCount, couponIds);
|
|
|
+ Utils.Instance.PrizeRecord(2, order.OrderNo, "结束打标记");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else if(parentUser.OperateLevel > 0 && CheckOpReserve(opdb, order.BuyCount, parentUser.Id) && BuyPrizeFlag < 2)
|
|
|
+ {
|
|
|
+ Utils.Instance.PrizeRecord(2, order.OrderNo, "满足条件,发放购机奖");
|
|
|
+ //购机奖
|
|
|
+ decimal CurBuyPrize = GetBuyPrize(parentUser, order);
|
|
|
+ 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);
|
|
|
+ }
|
|
|
+>>>>>>> feat-lcl-训练营奖励拦截记录
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -497,7 +581,7 @@ namespace MySystem
|
|
|
//购机奖
|
|
|
if(parentUser.LeaderLevel > 0)
|
|
|
{
|
|
|
- decimal CurBuyPrize = GetBuyPrize(parentUser, order.UserId);
|
|
|
+ decimal CurBuyPrize = GetBuyPrize(parentUser, order);
|
|
|
decimal GetPrize = CurBuyPrize - BuyPrize;
|
|
|
if(GetPrize > 0)
|
|
|
{
|
|
@@ -532,7 +616,7 @@ namespace MySystem
|
|
|
else if(parentUser.OperateLevel > 0 && CheckOpReserve(opdb, order.BuyCount, parentUser.Id))
|
|
|
{
|
|
|
//购机奖
|
|
|
- decimal CurBuyPrize = GetBuyPrize(parentUser, order.UserId);
|
|
|
+ decimal CurBuyPrize = GetBuyPrize(parentUser, order);
|
|
|
decimal GetPrize = CurBuyPrize - BuyPrize;
|
|
|
if(GetPrize > 0)
|
|
|
{
|
|
@@ -1083,7 +1167,7 @@ namespace MySystem
|
|
|
/// </summary>
|
|
|
/// <param name="user"></param>
|
|
|
/// <returns></returns>
|
|
|
- public decimal GetBuyPrize(UserRankItem user, int OrderUserId = 0)
|
|
|
+ public decimal GetBuyPrize(UserRankItem user, Orders order)
|
|
|
{
|
|
|
if(user.OperateLevel == 1) return 100;
|
|
|
if(user.OperateLevel == 2)
|
|
@@ -1092,8 +1176,10 @@ namespace MySystem
|
|
|
{
|
|
|
return 160;
|
|
|
}
|
|
|
- if(!TradeTeamCheck(OrderUserId) && user.Id != OrderUserId)
|
|
|
+ if(!TradeTeamCheck(order.UserId) && user.Id != order.UserId)
|
|
|
{
|
|
|
+ decimal Amount = order.BuyCount * 60;
|
|
|
+ RedisDbconn.Instance.AddList("TradeFilterQueue", "{\"OrderId\":\"" + order.Id + "\",\"PrizeUserId\":\"" + user.Id + "\",\"Amount\":\"" + Amount + "\",\"Kind\":\"1\"}");
|
|
|
return 100;
|
|
|
}
|
|
|
return 160;
|