|
@@ -60,6 +60,7 @@ namespace MySystem
|
|
|
try
|
|
|
{
|
|
|
dosomething3();
|
|
|
+ activePrizeWithoutDeposit();
|
|
|
string Msg = "success";
|
|
|
jobInfo.Status = Msg == "success" ? 1 : 0;
|
|
|
jobInfo.Msg = Msg == "success" ? "执行完成" : Msg;
|
|
@@ -307,6 +308,45 @@ namespace MySystem
|
|
|
}
|
|
|
db.Dispose();
|
|
|
}
|
|
|
+ public void activePrizeWithoutDeposit(int posid = 0)
|
|
|
+ {
|
|
|
+ WebCMSEntities db = new WebCMSEntities();
|
|
|
+ DateTime yesterday = DateTime.Now.AddDays(-1);
|
|
|
+ DateTime today = DateTime.Now;
|
|
|
+ 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)
|
|
|
+ {
|
|
|
+ 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]);
|
|
|
+ }
|
|
|
+ if(pos.BrandId == 6)
|
|
|
+ {
|
|
|
+ doActiveReward(db, merchant, pos, GetUserId, ParentNav, TopUserId, 50);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ db.Dispose();
|
|
|
+ }
|
|
|
|
|
|
public void doActiveReward(WebCMSEntities db, PosMerchantInfo merchant, PosMachinesTwo pos, int GetUserId, string ParentNav, int TopUserId, decimal ActPrize, int ChangeType = 0)
|
|
|
{
|