|
@@ -886,17 +886,21 @@ namespace MySystem
|
|
|
List<PosMachinesTwo> posList = db.PosMachinesTwo.Where(m => m.Id == PosId && m.ActivationState == 1 && !string.IsNullOrEmpty(m.SeoKeyword) && m.SeoKeyword != "0" && m.CreditTrade >= 1000).ToList();
|
|
|
foreach (PosMachinesTwo pos in posList)
|
|
|
{
|
|
|
+ function.WriteLog("\n\n" + DateTime.Now.ToString() + "\nsn:" + pos.PosSn, "开机奖励发放日志");
|
|
|
if (pos.BindingTime > DateTime.Now.AddDays(-30))
|
|
|
{
|
|
|
decimal ActPrize = decimal.Parse(function.CheckNum(pos.SeoKeyword));
|
|
|
+ function.WriteLog("押金:" + pos.SeoKeyword, "开机奖励发放日志");
|
|
|
if (ActPrize > 0)
|
|
|
{
|
|
|
PosMerchantInfo merchant = db.PosMerchantInfo.FirstOrDefault(m => m.Id == pos.BindMerchantId);
|
|
|
if (merchant != null)
|
|
|
{
|
|
|
+ function.WriteLog("商户:" + merchant.KqMerNo, "开机奖励发放日志");
|
|
|
Users user = db.Users.FirstOrDefault(m => m.Id == pos.BuyUserId);
|
|
|
if (user != null)
|
|
|
{
|
|
|
+ function.WriteLog("所属人:" + user.MakerCode, "开机奖励发放日志");
|
|
|
if (!string.IsNullOrEmpty(user.ParentNav))
|
|
|
{
|
|
|
decimal Prize = 20;
|
|
@@ -907,13 +911,16 @@ namespace MySystem
|
|
|
Users puser = db.Users.FirstOrDefault(m => m.Id == UserId && m.AuthFlag == 1);
|
|
|
if (puser != null && Prize > 0)
|
|
|
{
|
|
|
+ function.WriteLog("上级:" + puser.MakerCode, "开机奖励发放日志");
|
|
|
int machineCount = db.PosMachinesTwo.Count(m => m.BuyUserId == puser.Id && m.PosSnType == 0 && m.ActivationState == 0); //判断是否拥有3台兑换机
|
|
|
int ActiveCount = db.PosMachinesTwo.Count(m => m.BuyUserId == puser.Id && m.ActivationState == 1); //判断是否拥有3台激活机(不限购买或赠送)
|
|
|
int couponCount = db.PosCoupons.Count(m => m.UserId == puser.Id && m.IsUse == 0); //判断是否拥有3张券
|
|
|
// int BigCount = db.PosMachinesTwo.Count(m => m.UserId == puser.Id && m.BrandId == 3); //判断是否拥有2台大机
|
|
|
// int BigActiveCount = db.PosMachinesTwo.Count(m => m.UserId == puser.Id && m.ActivationState == 1 && m.BrandId == 3); //判断是否拥有2台激活大机(不限购买或赠送)
|
|
|
+ function.WriteLog("条件:machineCount:" + machineCount + ",ActiveCount:" + ActiveCount + ",couponCount:" + couponCount + "", "开机奖励发放日志");
|
|
|
if (machineCount + ActiveCount + couponCount >= 3)
|
|
|
{
|
|
|
+ function.WriteLog("满足条件", "开机奖励发放日志");
|
|
|
int pTopUserId = 0;
|
|
|
if (!string.IsNullOrEmpty(puser.ParentNav))
|
|
|
{
|