|
@@ -160,7 +160,7 @@ namespace MySystem
|
|
|
foreach (var user in users)
|
|
|
{
|
|
|
int machineCount = db.PosMachinesTwo.Count(m => m.UserId == user.Id && m.PosSnType == 0);
|
|
|
- if (machineCount >= 3)
|
|
|
+ if (machineCount > 1)
|
|
|
{
|
|
|
Users edit = db.Users.FirstOrDefault(m => m.Id == user.Id);
|
|
|
if (edit != null)
|
|
@@ -256,13 +256,21 @@ namespace MySystem
|
|
|
}
|
|
|
|
|
|
// 3. 前一天的激活记录,根据创客类型,如果是商户型创客,则激活奖励的起始人从此人上级计算。如果不是,则从此人开始计算
|
|
|
- public void dosomething3()
|
|
|
- {
|
|
|
+ public void dosomething3(int posid = 0)
|
|
|
+ {
|
|
|
WebCMSEntities db = new WebCMSEntities();
|
|
|
DateTime yesterday = DateTime.Now.AddHours(-3);
|
|
|
DateTime today = DateTime.Now;
|
|
|
- List<PosMachinesTwo> posList = db.PosMachinesTwo.Where(m => m.ActivationState == 1 && m.ActivationTime >= yesterday && m.ActivationTime < today && !string.IsNullOrEmpty(m.SeoKeyword)).ToList();
|
|
|
- foreach (PosMachinesTwo pos in posList)
|
|
|
+ IQueryable<PosMachinesTwo> posList = db.PosMachinesTwo.Where(m => m.ActivationState == 1 && !string.IsNullOrEmpty(m.SeoKeyword));
|
|
|
+ if (posid > 0)
|
|
|
+ {
|
|
|
+ posList = posList.Where(m => m.Id == posid);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ posList = posList.Where(m => m.ActivationTime >= yesterday && m.ActivationTime < today);
|
|
|
+ }
|
|
|
+ foreach (PosMachinesTwo pos in posList.ToList())
|
|
|
{
|
|
|
PosMerchantInfo merchant = db.PosMerchantInfo.FirstOrDefault(m => m.Id == pos.BindMerchantId);
|
|
|
if (merchant != null)
|
|
@@ -285,7 +293,11 @@ namespace MySystem
|
|
|
{
|
|
|
TopUserId = int.Parse(ParentNav.Trim(',').Replace(",,", ",").Split(',')[0]);
|
|
|
}
|
|
|
- decimal ActPrize = decimal.Parse(function.CheckNum(pos.SeoKeyword)) / 100;
|
|
|
+ decimal ActPrize = decimal.Parse(function.CheckNum(pos.SeoKeyword));
|
|
|
+ if (pos.BrandId == 1)
|
|
|
+ {
|
|
|
+ ActPrize = ActPrize / 100;
|
|
|
+ }
|
|
|
if (ActPrize > 0)
|
|
|
{
|
|
|
bool check = db.ActiveReward.Any(m => m.KqSnNo == pos.PosSn);
|
|
@@ -377,8 +389,8 @@ namespace MySystem
|
|
|
db.SaveChanges();
|
|
|
RedisDbconn.Instance.Set("UserAccount:" + GetUserId, account);
|
|
|
|
|
|
- string dateString = yesterday.ToString("yyyyMMdd");
|
|
|
- string monthString = yesterday.ToString("yyyyMM");
|
|
|
+ string dateString = pos.ActivationTime.Value.ToString("yyyyMMdd");
|
|
|
+ string monthString = pos.ActivationTime.Value.ToString("yyyyMM");
|
|
|
// 激活奖励列表
|
|
|
List<string> dates = RedisDbconn.Instance.GetList<string>("ActiveRewardDay:" + GetUserId + ":" + pos.BrandId);
|
|
|
if (!dates.Contains(dateString))
|