浏览代码

职级取值问题

lcl 1 月之前
父节点
当前提交
bae7beb1a4

+ 2 - 0
Startup.cs

@@ -168,6 +168,8 @@ namespace MySystem
                 ProfitHelper.Instance.StartSetDivi(); //设置订单当前返现金额
                 ProfitBeforeHelper.Instance.StartListenProfit(); //每月分润
                 ProfitAfterHelper.Instance.StartListenProfit(); //每月分润
+                ProfitBeforeNewHelper.Instance.StartListenProfit(); //每月分润
+                ProfitAfterNewHelper.Instance.StartListenProfit(); //每月分润
                 ProfitCheckHelper.Instance.Start(); //检查订单是否在队列里
 
                 AlipayPayBackFeeService.Instance.Start();

+ 2 - 2
Util/HaoDa/ProfitAfterHelper.cs

@@ -289,11 +289,11 @@ namespace MySystem
         public SubUser GetUser(int UserId, string Month)
         {
             SubUser user = new SubUser();
-            DataTable dt = GetDataTable("select * from kxs_trade_level_log where trade_month=" + Month + " where user_id=" + UserId);
+            DataTable dt = GetDataTable("select * from kxs_trade_level_log where trade_month=" + Month + " and version=0 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.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());

+ 4 - 4
Util/HaoDa/ProfitAfterNewHelper.cs

@@ -189,10 +189,10 @@ namespace MySystem
             ProfitObjects obj = db.ProfitObjects.FirstOrDefault();
             if (obj.Status == 1) //判断分润是否开启
             {
-                int maxLevel = obj.MaxLevel; //最大等级
+                int maxLevel = 5; //最大等级
                 int maxFloor = obj.MaxFloor; //最大层级
                 decimal diffLevelProfit = 0;  //等级级差
-                ProfitObjectLevels maxlevel = db.ProfitObjectLevels.FirstOrDefault(m => m.LevelNumber == 9) ?? new ProfitObjectLevels(); //获取最高等级参数
+                ProfitObjectLevels maxlevel = db.ProfitObjectLevels.FirstOrDefault(m => m.LevelNumber == 5 && m.Version == 1) ?? new ProfitObjectLevels(); //获取最高等级参数
                 decimal maxPercent = IsActive ? maxlevel.DebitPercents : maxlevel.Percents;
                 LogHelper.Instance.WriteLog("maxPercent:" + maxPercent + ";", "来客吧分润日志");
                 decimal maxLevelProfit = TotalAmount * maxPercent;
@@ -290,11 +290,11 @@ namespace MySystem
         public SubUser GetUser(int UserId, string Month)
         {
             SubUser user = new SubUser();
-            DataTable dt = GetDataTable("select * from kxs_trade_level_log where trade_month=" + Month + " where user_id=" + UserId);
+            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.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());

+ 2 - 2
Util/HaoDa/ProfitBeforeHelper.cs

@@ -291,11 +291,11 @@ namespace MySystem
         public SubUser GetUser(int UserId, string Month)
         {
             SubUser user = new SubUser();
-            DataTable dt = GetDataTable("select * from kxs_trade_level_log where trade_month=" + Month + " where user_id=" + UserId);
+            DataTable dt = GetDataTable("select * from kxs_trade_level_log where trade_month=" + Month + " and version=0 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.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());

+ 4 - 4
Util/HaoDa/ProfitBeforeNewHelper.cs

@@ -191,10 +191,10 @@ namespace MySystem
             ProfitObjects obj = db.ProfitObjects.FirstOrDefault();
             if (obj.Status == 1) //判断分润是否开启
             {
-                int maxLevel = obj.MaxLevel; //最大等级
+                int maxLevel = 5; //最大等级
                 int maxFloor = obj.MaxFloor; //最大层级
                 decimal diffLevelProfit = 0;  //等级级差
-                ProfitObjectLevels maxlevel = db.ProfitObjectLevels.FirstOrDefault(m => m.LevelNumber == 9) ?? new ProfitObjectLevels(); //获取最高等级参数
+                ProfitObjectLevels maxlevel = db.ProfitObjectLevels.FirstOrDefault(m => m.LevelNumber == 5 && m.Version == 1) ?? new ProfitObjectLevels(); //获取最高等级参数
                 decimal maxPercent = IsActive ? maxlevel.DebitPercents : maxlevel.Percents;
                 LogHelper.Instance.WriteLog("maxPercent:" + maxPercent + ";", "来客吧分润日志");
                 decimal maxLevelProfit = TotalAmount * maxPercent;
@@ -292,11 +292,11 @@ namespace MySystem
         public SubUser GetUser(int UserId, string Month)
         {
             SubUser user = new SubUser();
-            DataTable dt = GetDataTable("select * from kxs_trade_level_log where trade_month=" + Month + " where user_id=" + UserId);
+            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.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());