|
@@ -184,6 +184,7 @@ namespace MySystem
|
|
|
LogHelper.Instance.WriteLog("\n\nTotalAmount:" + TotalAmount + ";", "来客吧分润日志");
|
|
|
string Month = DateTime.Now.AddMonths(-1).ToString("yyyyMM");
|
|
|
WebCMSEntities db = new WebCMSEntities();
|
|
|
+ KxsUserModels.WebCMSEntities udb = new KxsUserModels.WebCMSEntities();
|
|
|
List<UserLevelSet> levels = db.UserLevelSet.ToList();
|
|
|
List<ProfitResult> result = new List<ProfitResult>();
|
|
|
ProfitObjects obj = db.ProfitObjects.FirstOrDefault();
|
|
@@ -229,7 +230,7 @@ namespace MySystem
|
|
|
{
|
|
|
user = users[curFloor - 1];
|
|
|
}
|
|
|
- SubUser selfUser = GetUser(user.UserId, Month) ?? new SubUser();
|
|
|
+ SubUser selfUser = GetUser(udb, user.UserId, int.Parse(Month)) ?? new SubUser();
|
|
|
int UserLevel = GetUserLevel(selfUser); //当前会员等级
|
|
|
//判断当前创客是否有直推的激活机具,并且在活动时间内
|
|
|
if (curLevel == maxLevel)
|
|
@@ -284,23 +285,35 @@ namespace MySystem
|
|
|
}
|
|
|
}
|
|
|
db.Dispose();
|
|
|
+ udb.Dispose();
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
- public SubUser GetUser(int UserId, string Month)
|
|
|
+ public SubUser GetUser(KxsUserModels.WebCMSEntities db, int UserId, int Month)
|
|
|
{
|
|
|
SubUser user = new SubUser();
|
|
|
- DataTable dt = GetDataTable("select * from kxs_trade_level_log where trade_month=" + Month + " and version=1 and user_id=" + UserId);
|
|
|
- if (dt.Rows.Count > 0)
|
|
|
+ KxsUserModels.KxsTradeLevelLog log = db.KxsTradeLevelLog.FirstOrDefault(m => m.TradeMonth == Month && m.Version == 1 && m.UserId == UserId);
|
|
|
+ if(log != null)
|
|
|
{
|
|
|
- user.Id = int.Parse(dt.Rows[0]["user_id"].ToString());
|
|
|
- // user.ParentUserId = int.Parse(dt.Rows[0]["ParentUserId"].ToString());
|
|
|
- user.Level = int.Parse(dt.Rows[0]["level"].ToString());
|
|
|
- user.ParentNav = dt.Rows[0]["pid_path"].ToString();
|
|
|
- user.UserLevel = int.Parse(dt.Rows[0]["user_level"].ToString());
|
|
|
- user.PreUserLevel = int.Parse(dt.Rows[0]["pre_level"].ToString());
|
|
|
- user.PreLeaderLevel = int.Parse(dt.Rows[0]["leader_level"].ToString());
|
|
|
+ user.Id = log.UserId;
|
|
|
+ user.Level = log.Level;
|
|
|
+ user.ParentNav = log.PidPath;
|
|
|
+ user.UserLevel = log.UserLevel;
|
|
|
+ user.PreUserLevel = log.PreLevel;
|
|
|
+ user.PreLeaderLevel = log.LeaderLevel;;
|
|
|
}
|
|
|
+ // DataTable dt = GetDataTable("select * from kxs_trade_level_log where trade_month=" + Month + " and version=1 and user_id=" + UserId);
|
|
|
+ // if (dt.Rows.Count > 0)
|
|
|
+ // {
|
|
|
+ // user.Id = int.Parse(dt.Rows[0]["user_id"].ToString());
|
|
|
+ // // user.ParentUserId = int.Parse(dt.Rows[0]["ParentUserId"].ToString());
|
|
|
+ // user.Level = int.Parse(dt.Rows[0]["level"].ToString());
|
|
|
+ // user.ParentNav = dt.Rows[0]["pid_path"].ToString();
|
|
|
+ // user.UserLevel = int.Parse(dt.Rows[0]["user_level"].ToString());
|
|
|
+ // user.PreUserLevel = int.Parse(dt.Rows[0]["pre_level"].ToString());
|
|
|
+ // user.PreLeaderLevel = int.Parse(dt.Rows[0]["leader_level"].ToString());
|
|
|
+ // function.WriteLog(Newtonsoft.Json.JsonConvert.SerializeObject(user), "检查666");
|
|
|
+ // }
|
|
|
return user;
|
|
|
}
|
|
|
|