尊敬的" + user.RealName + "盟主您好:
您的盟主权益将在" + day.Days + "天后到期,为保障您的收益持续到账,请尽快续期! div > ",//内容
CreateDate = DateTime.Now,
}));
}
}
if (time > leaderTimeOutDate && time <= leaderTimeOutDate.AddMonths(1))
{
int number = 1; //提示标记(第几次)
int timespan = 60 * 60 * 24 * 8;
TimeSpan ts = time - leaderTimeOutDate;
if(ts.Days == 0 || ts.Days == 1)
{
number = 1;
timespan = 60 * 60 * 24 * 8;
}
if(ts.Days == 7 || ts.Days == 8)
{
number = 2;
timespan = 60 * 60 * 24 * 8;
}
if(ts.Days == 14 || ts.Days == 15)
{
number = 3;
timespan = 60 * 60 * 24 * 15;
}
if(ts.Days == 28 || ts.Days == 29)
{
number = 4;
timespan = 60 * 60 * 24 * 5;
}
string flag = RedisDbconn.Instance.Get
("MsgPersonalAfter:" + number + ":" + item.UserId);
if(string.IsNullOrEmpty(flag))
{
RedisDbconn.Instance.Set("MsgPersonalAfter:" + number + ":" + item.UserId, "1");
RedisDbconn.Instance.SetExpire("MsgPersonalAfter:" + number + ":" + item.UserId, timespan);
RedisDbconn.Instance.AddList("MsgPersonalQueue", Newtonsoft.Json.JsonConvert.SerializeObject(new MsgPersonal()
{
UserId = item.UserId, //创客
Title = "盟主权益到期提醒", //标题
Content = "尊敬的" + user.RealName + "盟主您好:
您的盟主已经过期,重新开通后可恢复相关权益! div > ",//内容
CreateDate = DateTime.Now,
}));
}
}
}
}
}
catch (Exception ex)
{
function.WriteLog(DateTime.Now.ToString() + "\n" + ex.ToString(), "盟主过期消息推送线程异常");
}
}
Thread.Sleep(1000);
}
}
}