|
@@ -884,7 +884,13 @@ namespace MySystem.Controllers
|
|
|
public string leaderflag()
|
|
|
{
|
|
|
WebCMSEntities db = new WebCMSEntities();
|
|
|
- List<PosCoupons> coupons = db.PosCoupons.Where(m => m.LeaderUserId > 0 && m.IsUse == 1).ToList();
|
|
|
+ List<int> ids = new List<int>();
|
|
|
+ List<PosCouponRecord> records = db.PosCouponRecord.Where(m => m.FromUserId == 597).ToList();
|
|
|
+ foreach(PosCouponRecord record in records)
|
|
|
+ {
|
|
|
+ ids.Add(record.PosCouponId);
|
|
|
+ }
|
|
|
+ List<PosCoupons> coupons = db.PosCoupons.Where(m => ids.Contains(m.Id) && m.IsUse == 1).ToList();
|
|
|
foreach (PosCoupons coupon in coupons)
|
|
|
{
|
|
|
MachineApply apply = db.MachineApply.FirstOrDefault(m => m.SwapSnExpand.Contains(coupon.ExchangeCode));
|
|
@@ -904,7 +910,7 @@ namespace MySystem.Controllers
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- db.SaveChanges();
|
|
|
+ // db.SaveChanges();
|
|
|
db.Dispose();
|
|
|
return "ok";
|
|
|
}
|
|
@@ -931,8 +937,10 @@ namespace MySystem.Controllers
|
|
|
PosMachinesTwo pos = db.PosMachinesTwo.FirstOrDefault(m=>m.Id == forSnNo.SnId);
|
|
|
if(pos != null)
|
|
|
{
|
|
|
- pos.LeaderUserId = LeaderUserId;
|
|
|
- Library.function.WriteLog(LeaderUserId + ":" + pos.PosSn + ":" + apply.SwapSnExpand.TrimEnd('\n').Split('\n').Length, "大盟主奖励标记机具");
|
|
|
+ // pos.LeaderUserId = LeaderUserId;
|
|
|
+ // Library.function.WriteLog(LeaderUserId + ":" + pos.PosSn + ":" + apply.SwapSnExpand.TrimEnd('\n').Split('\n').Length, "大盟主奖励标记机具");
|
|
|
+ Users user = db.Users.FirstOrDefault(m => m.Id == pos.BuyUserId) ?? new Users();
|
|
|
+ Library.function.WriteLog(pos.PosSn + ":" + user.MakerCode + ":" + user.RealName, "大盟主奖励标记机具");
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -943,8 +951,10 @@ namespace MySystem.Controllers
|
|
|
PosMachinesTwo pos = db.PosMachinesTwo.FirstOrDefault(m=>m.Id == forSnNo.SnId);
|
|
|
if(pos != null)
|
|
|
{
|
|
|
- pos.LeaderUserId = LeaderUserId;
|
|
|
- Library.function.WriteLog(LeaderUserId + ":" + pos.PosSn, "大盟主奖励标记机具");
|
|
|
+ // pos.LeaderUserId = LeaderUserId;
|
|
|
+ // Library.function.WriteLog(LeaderUserId + ":" + pos.PosSn, "大盟主奖励标记机具");
|
|
|
+ Users user = db.Users.FirstOrDefault(m => m.Id == pos.BuyUserId) ?? new Users();
|
|
|
+ Library.function.WriteLog(pos.PosSn + ":" + user.MakerCode + ":" + user.RealName, "大盟主奖励标记机具");
|
|
|
}
|
|
|
}
|
|
|
}
|