|
@@ -51,7 +51,7 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
/// 盟主管理列表
|
|
/// 盟主管理列表
|
|
|
/// </summary>
|
|
/// </summary>
|
|
|
/// <returns></returns>
|
|
/// <returns></returns>
|
|
|
- public JsonResult IndexData(Leaders data, string UserIdMakerCode, string LeaderLevelSelect, string CreateDateData, int page = 1, int limit = 30)
|
|
|
|
|
|
|
+ public JsonResult IndexData(Leaders data, string UserIdMakerCode, string LeaderLevelSelect, string LeaderStatusSelect, string UpateDateData, string LeaderTimeOutDateData, string CreateDateData, int page = 1, int limit = 30)
|
|
|
{
|
|
{
|
|
|
|
|
|
|
|
Dictionary<string, string> Fields = new Dictionary<string, string>();
|
|
Dictionary<string, string> Fields = new Dictionary<string, string>();
|
|
@@ -67,7 +67,42 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
{
|
|
{
|
|
|
condition += " and LeaderLevel=" + LeaderLevelSelect;
|
|
condition += " and LeaderLevel=" + LeaderLevelSelect;
|
|
|
}
|
|
}
|
|
|
- //创建时间
|
|
|
|
|
|
|
+ //状态
|
|
|
|
|
+ if (!string.IsNullOrEmpty(LeaderStatusSelect))
|
|
|
|
|
+ {
|
|
|
|
|
+ var leaders = db.Leaders.Select(m => new { m.UserId }).ToList();
|
|
|
|
|
+ var Ids = "";
|
|
|
|
|
+ DateTime time = DateTime.Now;
|
|
|
|
|
+ if (LeaderStatusSelect == "0")
|
|
|
|
|
+ {
|
|
|
|
|
+ foreach (var item in leaders)
|
|
|
|
|
+ {
|
|
|
|
|
+ var userRankWhite = db.UserRankWhite.FirstOrDefault(m => m.Id == item.UserId && m.UpdateDate >= time) ?? new UserRankWhite();
|
|
|
|
|
+ if (userRankWhite.Id > 0)
|
|
|
|
|
+ {
|
|
|
|
|
+ Ids += item.UserId + ",";
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ Ids = Ids.TrimEnd(',');
|
|
|
|
|
+ condition += " and Id in (" + Ids + ")";
|
|
|
|
|
+ }
|
|
|
|
|
+ else
|
|
|
|
|
+ {
|
|
|
|
|
+
|
|
|
|
|
+ foreach (var item in leaders)
|
|
|
|
|
+ {
|
|
|
|
|
+ var userRankWhite = db.UserRankWhite.FirstOrDefault(m => m.Id == item.UserId && m.UpdateDate >= time) ?? new UserRankWhite();
|
|
|
|
|
+ if (userRankWhite.Id > 0)
|
|
|
|
|
+ {
|
|
|
|
|
+ Ids += item.UserId + ",";
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ Ids = Ids.TrimEnd(',');
|
|
|
|
|
+ condition += " and Id in (" + Ids + ")";
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+ //首次购买时间
|
|
|
if (!string.IsNullOrEmpty(CreateDateData))
|
|
if (!string.IsNullOrEmpty(CreateDateData))
|
|
|
{
|
|
{
|
|
|
string[] datelist = CreateDateData.Split(new string[] { " - " }, StringSplitOptions.None);
|
|
string[] datelist = CreateDateData.Split(new string[] { " - " }, StringSplitOptions.None);
|
|
@@ -75,6 +110,33 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
string end = datelist[1];
|
|
string end = datelist[1];
|
|
|
condition += " and CreateDate>='" + start + " 00:00:00' and CreateDate<='" + end + " 23:59:59'";
|
|
condition += " and CreateDate>='" + start + " 00:00:00' and CreateDate<='" + end + " 23:59:59'";
|
|
|
}
|
|
}
|
|
|
|
|
+ //最后购买时间
|
|
|
|
|
+ if (!string.IsNullOrEmpty(UpateDateData))
|
|
|
|
|
+ {
|
|
|
|
|
+ string[] datelist = UpateDateData.Split(new string[] { " - " }, StringSplitOptions.None);
|
|
|
|
|
+ string start = datelist[0];
|
|
|
|
|
+ string end = datelist[1];
|
|
|
|
|
+ condition += " and UpateDate>='" + start + " 00:00:00' and UpateDate<='" + end + " 23:59:59'";
|
|
|
|
|
+ }
|
|
|
|
|
+ //盟主到期时间
|
|
|
|
|
+ if (!string.IsNullOrEmpty(LeaderTimeOutDateData))
|
|
|
|
|
+ {
|
|
|
|
|
+ string[] datelist = LeaderTimeOutDateData.Split(new string[] { " - " }, StringSplitOptions.None);
|
|
|
|
|
+ DateTime start = DateTime.Parse(datelist[0] + " 00:00:00");
|
|
|
|
|
+ DateTime end = DateTime.Parse(datelist[1] + " 23:59:59");
|
|
|
|
|
+ var leaders = db.Leaders.Select(m => new { m.UserId }).ToList();
|
|
|
|
|
+ var Ids = "";
|
|
|
|
|
+ foreach (var item in leaders)
|
|
|
|
|
+ {
|
|
|
|
|
+ var userRankWhite = db.UserRankWhite.FirstOrDefault(m => m.Id == item.UserId && m.UpdateDate >= start && m.UpdateDate <= end) ?? new UserRankWhite();
|
|
|
|
|
+ if (userRankWhite.Id > 0)
|
|
|
|
|
+ {
|
|
|
|
|
+ Ids += item.UserId + ",";
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ Ids = Ids.TrimEnd(',');
|
|
|
|
|
+ condition += " and Id in (" + Ids + ")";
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
|
|
|
|
|
Dictionary<string, object> obj = new AdminContentOther(_accessor.HttpContext, PublicFunction.MainTables).IndexData("Leaders", Fields, "Id desc", "0", page, limit, condition);
|
|
Dictionary<string, object> obj = new AdminContentOther(_accessor.HttpContext, PublicFunction.MainTables).IndexData("Leaders", Fields, "Id desc", "0", page, limit, condition);
|
|
@@ -90,6 +152,17 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
dic["UserIdRealName"] = userid_Users.RealName;
|
|
dic["UserIdRealName"] = userid_Users.RealName;
|
|
|
dic["LeaderReserve"] = userAccount.LeaderReserve;
|
|
dic["LeaderReserve"] = userAccount.LeaderReserve;
|
|
|
dic["LeaderBalanceAmount"] = userAccount.LeaderBalanceAmount;
|
|
dic["LeaderBalanceAmount"] = userAccount.LeaderBalanceAmount;
|
|
|
|
|
+
|
|
|
|
|
+ var userRankWhite = db.UserRankWhite.FirstOrDefault(m => m.Id == UserId) ?? new UserRankWhite();
|
|
|
|
|
+ if (userRankWhite.UpdateDate > DateTime.Now)
|
|
|
|
|
+ {
|
|
|
|
|
+ dic["LeaderStatus"] = "未过期";
|
|
|
|
|
+ }
|
|
|
|
|
+ else
|
|
|
|
|
+ {
|
|
|
|
|
+ dic["LeaderStatus"] = "已过期";
|
|
|
|
|
+ }
|
|
|
|
|
+ dic["LeaderTimeOutDate"] = userRankWhite.UpdateDate;
|
|
|
dic.Remove("UserId");
|
|
dic.Remove("UserId");
|
|
|
//盟主等级
|
|
//盟主等级
|
|
|
int LeaderLevel = int.Parse(dic["LeaderLevel"].ToString());
|
|
int LeaderLevel = int.Parse(dic["LeaderLevel"].ToString());
|