|
@@ -89,6 +89,7 @@ namespace MySystem
|
|
{
|
|
{
|
|
function.WriteLog(DateTime.Now.ToString() + ":start", "实时处理0押激活奖励");
|
|
function.WriteLog(DateTime.Now.ToString() + ":start", "实时处理0押激活奖励");
|
|
activePrizeWithoutDeposit();
|
|
activePrizeWithoutDeposit();
|
|
|
|
+ activePrizeWithoutDeposit6();
|
|
function.WriteLog(DateTime.Now.ToString() + ":end\n\n", "实时处理0押激活奖励");
|
|
function.WriteLog(DateTime.Now.ToString() + ":end\n\n", "实时处理0押激活奖励");
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
catch (Exception ex)
|
|
@@ -381,7 +382,7 @@ namespace MySystem
|
|
WebCMSEntities db = new WebCMSEntities();
|
|
WebCMSEntities db = new WebCMSEntities();
|
|
DateTime yesterday = DateTime.Now.AddDays(-1);
|
|
DateTime yesterday = DateTime.Now.AddDays(-1);
|
|
DateTime today = DateTime.Now.AddMinutes(-10);
|
|
DateTime today = DateTime.Now.AddMinutes(-10);
|
|
- IQueryable<PosMachinesTwo> posList = db.PosMachinesTwo.Where(m => m.ActivationState == 1 && string.IsNullOrEmpty(m.SeoKeyword) && m.BrandId != 12 && m.BrandId != 13 && m.Detail != "1");
|
|
|
|
|
|
+ IQueryable<PosMachinesTwo> posList = db.PosMachinesTwo.Where(m => m.ActivationState == 1 && string.IsNullOrEmpty(m.SeoKeyword) && m.BrandId != 12 && m.BrandId != 13 && m.BrandId != 6 && m.Detail != "1");
|
|
if (posid > 0)
|
|
if (posid > 0)
|
|
{
|
|
{
|
|
posList = posList.Where(m => m.Id == posid);
|
|
posList = posList.Where(m => m.Id == posid);
|
|
@@ -406,11 +407,7 @@ namespace MySystem
|
|
{
|
|
{
|
|
TopUserId = int.Parse(ParentNav.Trim(',').Replace(",,", ",").Split(',')[0]);
|
|
TopUserId = int.Parse(ParentNav.Trim(',').Replace(",,", ",").Split(',')[0]);
|
|
}
|
|
}
|
|
- // if(pos.BrandId == 6) //首台无押金机返50
|
|
|
|
- // {
|
|
|
|
- // doActiveReward(db, merchant, pos, GetUserId, ParentNav, TopUserId, 50);
|
|
|
|
- // }
|
|
|
|
- else if((pos.BrandId == 10 || pos.BrandId == 11) && DateTime.Now < DateTime.Parse("2023-05-01 00:00:00") && pos.IsFirst == 1) //首台无押金机返50
|
|
|
|
|
|
+ if((pos.BrandId == 10 || pos.BrandId == 11) && DateTime.Now < DateTime.Parse("2023-05-01 00:00:00") && pos.IsFirst == 1) //首台无押金机返50
|
|
{
|
|
{
|
|
doActiveReward(db, merchant, pos, GetUserId, ParentNav, TopUserId, 50);
|
|
doActiveReward(db, merchant, pos, GetUserId, ParentNav, TopUserId, 50);
|
|
}
|
|
}
|
|
@@ -431,6 +428,53 @@ namespace MySystem
|
|
db.Dispose();
|
|
db.Dispose();
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ public void activePrizeWithoutDeposit6(int posid = 0)
|
|
|
|
+ {
|
|
|
|
+ WebCMSEntities db = new WebCMSEntities();
|
|
|
|
+ DateTime yesterday = DateTime.Now.AddDays(-1);
|
|
|
|
+ DateTime today = DateTime.Now.AddMinutes(-10);
|
|
|
|
+ IQueryable<PosMachinesTwo> posList = db.PosMachinesTwo.Where(m => m.ActivationState == 1 && m.CreditTrade >= 5000 && string.IsNullOrEmpty(m.SeoKeyword) && m.BrandId == 6 && m.Detail != "1");
|
|
|
|
+ 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)
|
|
|
|
+ {
|
|
|
|
+ string ParentNav = "";
|
|
|
|
+ Users user = db.Users.FirstOrDefault(m => m.Id == pos.BuyUserId);
|
|
|
|
+ if (user != null)
|
|
|
|
+ {
|
|
|
|
+ int GetUserId = user.Id;
|
|
|
|
+ ParentNav = user.ParentNav;
|
|
|
|
+ int TopUserId = 0;
|
|
|
|
+ if (!string.IsNullOrEmpty(ParentNav))
|
|
|
|
+ {
|
|
|
|
+ TopUserId = int.Parse(ParentNav.Trim(',').Replace(",,", ",").Split(',')[0]);
|
|
|
|
+ }
|
|
|
|
+ // 立刷30天内刷满5000,无服务费机具,返50
|
|
|
|
+ if (pos.BrandId == 6 && pos.BindingTime > DateTime.Now.AddDays(-30))
|
|
|
|
+ {
|
|
|
|
+ doActiveReward(db, merchant, pos, GetUserId, ParentNav, TopUserId, 50);
|
|
|
|
+ }
|
|
|
|
+ PosMachinesTwo edit = db.PosMachinesTwo.FirstOrDefault(m => m.Id == pos.Id);
|
|
|
|
+ if(edit != null)
|
|
|
|
+ {
|
|
|
|
+ edit.Detail = "1";
|
|
|
|
+ db.SaveChanges();
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ db.Dispose();
|
|
|
|
+ }
|
|
|
|
+
|
|
public void activePrizeWithoutDeposit12(int posid = 0)
|
|
public void activePrizeWithoutDeposit12(int posid = 0)
|
|
{
|
|
{
|
|
WebCMSEntities db = new WebCMSEntities();
|
|
WebCMSEntities db = new WebCMSEntities();
|