|
@@ -1164,17 +1164,11 @@ namespace MySystem
|
|
|
for (int i = ParentNavs.Length - 1; i >= 0; i--)
|
|
|
{
|
|
|
int UserId = int.Parse(ParentNavs[i]);
|
|
|
- Users puser = db.Users.FirstOrDefault(m => m.Id == UserId && m.AuthFlag == 1 && m.Status > -1);
|
|
|
- if (puser != null && Prize > 0)
|
|
|
+ // Users puser = db.Users.FirstOrDefault(m => m.Id == UserId && m.AuthFlag == 1 && m.Status > -1);
|
|
|
+ UserRankItem puser = PosCouponPrizeService.Instance.GetUserLevel(db, UserId);
|
|
|
+ if (puser.Id > 0 && 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("条件:LeaderLevel:" + puser.LeaderLevel + ",UserType:" + puser.UserType, "开机奖励发放日志");
|
|
|
if(puser.LeaderLevel > 0 || puser.UserType == 1)
|
|
|
{
|