|
@@ -621,40 +621,16 @@ namespace MySystem
|
|
while(ParentUserId > 0)
|
|
while(ParentUserId > 0)
|
|
{
|
|
{
|
|
Users puser = db.Users.FirstOrDefault(m => m.Id == ParentUserId) ?? new Users();
|
|
Users puser = db.Users.FirstOrDefault(m => m.Id == ParentUserId) ?? new Users();
|
|
- int machineCount = db.PosMachinesTwo.Count(m => m.BuyUserId == ParentUserId && m.PosSnType == 0 && m.ActivationState == 0); //判断是否拥有3台兑换机
|
|
|
|
- int ActiveCount = db.PosMachinesTwo.Count(m => m.BuyUserId == ParentUserId && m.ActivationState == 1); //判断是否拥有3台激活机(不限购买或赠送)
|
|
|
|
- int couponCount = db.PosCoupons.Count(m => m.UserId == ParentUserId && m.IsUse == 0); //判断是否拥有3张券
|
|
|
|
- bool lkb_order = db.Orders.Any(m => m.UserId == ParentUserId && LkbIds.Contains(m.ProductId)); //判断是否已下单来客吧组合包系列产品
|
|
|
|
- function.WriteLog("MakerCode:" + puser.MakerCode, "推荐下单奖励监控日志");
|
|
|
|
- function.WriteLog("machineCount:" + machineCount, "推荐下单奖励监控日志");
|
|
|
|
- function.WriteLog("ActiveCount:" + ActiveCount, "推荐下单奖励监控日志");
|
|
|
|
- if (Utils.Instance.IsStandardUser(ParentUserId))
|
|
|
|
|
|
+ bool valid = Utils.Instance.IsStandardUser(ParentUserId);
|
|
|
|
+ function.WriteLog("是否有效创客:" + valid, "推荐下单奖励监控日志");
|
|
|
|
+ if (valid)
|
|
{
|
|
{
|
|
- // function.WriteLog("满足条件", "推荐下单奖励监控日志");
|
|
|
|
- // if(puser.LeaderLevel == 0) // 非盟主直推奖励,每个创客第一次下单,上级可得
|
|
|
|
- // {
|
|
|
|
- // List<int> oids = new List<int>();
|
|
|
|
- // var orderpros = db.OrderProduct.Select(m => new { m.OrderId,m.UserId,m.ProductId }).Where(m => m.UserId == order.UserId && proids.Contains(m.ProductId)).ToList();
|
|
|
|
- // foreach(var orderpro in orderpros)
|
|
|
|
- // {
|
|
|
|
- // oids.Add(orderpro.OrderId);
|
|
|
|
- // }
|
|
|
|
- // bool check = db.Orders.Any(m => oids.Contains(m.Id) && m.Status > 0);
|
|
|
|
- // if(!check)
|
|
|
|
- // {
|
|
|
|
- // DirectPrize(db, order.Id, ParentUserId, pro.ProductCount);
|
|
|
|
- // directPrize = true;
|
|
|
|
- // }
|
|
|
|
- // }
|
|
|
|
- // else
|
|
|
|
- // {
|
|
|
|
- // 盟主直推奖励,可以每次下单获得
|
|
|
|
|
|
+ // 盟主直推奖励,可以每次下单获得
|
|
if(!directPrize)
|
|
if(!directPrize)
|
|
{
|
|
{
|
|
DirectPrize(db, order.Id, ParentUserId, pro.ProductCount);
|
|
DirectPrize(db, order.Id, ParentUserId, pro.ProductCount);
|
|
directPrize = true;
|
|
directPrize = true;
|
|
}
|
|
}
|
|
- // }
|
|
|
|
|
|
|
|
//推荐下单上级获得30天的机具循环天数
|
|
//推荐下单上级获得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();
|
|
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();
|