|
|
@@ -61,12 +61,13 @@ namespace MySystem
|
|
|
KxsMainModels.WebCMSEntities kxsdb = new KxsMainModels.WebCMSEntities();
|
|
|
WebCMSEntities dbnew = new WebCMSEntities();
|
|
|
KxsUserModels.WebCMSEntities udb = new KxsUserModels.WebCMSEntities();
|
|
|
- DataTable dt = CustomerSqlConn.dtable("select IsAct,UserId,sum(TotalAmount) from UserAmountSummaryNewBefore where TradeMonth='" + TradeMonth + "' and SeoTitle='self' group by IsAct,UserId", MysqlConn.SqlConnStr);
|
|
|
+ DataTable dt = CustomerSqlConn.dtable("select IsAct,UserId,sum(TotalAmount),QueryCount from UserAmountSummaryNewBefore where TradeMonth='" + TradeMonth + "' and SeoTitle='self' group by IsAct,UserId,QueryCount", MysqlConn.SqlConnStr);
|
|
|
foreach(DataRow dr in dt.Rows)
|
|
|
{
|
|
|
int UserId = int.Parse(dr["UserId"].ToString());
|
|
|
bool IsActive = dr["IsAct"].ToString() == "1";
|
|
|
decimal TotalAmount = decimal.Parse(dr[2].ToString());
|
|
|
+ bool WenDing = dr["QueryCount"].ToString() == "1";
|
|
|
List<ProfitUsers> users = new List<ProfitUsers>();
|
|
|
int TopUserId = 0; //顶级创客Id
|
|
|
KxsUserModels.KxsUser us = udb.KxsUser.FirstOrDefault(a => a.Id == UserId);
|
|
|
@@ -108,7 +109,7 @@ namespace MySystem
|
|
|
}
|
|
|
KxsUserModels.KxsUser topUser = udb.KxsUser.FirstOrDefault(a => a.Id == TopUserId) ?? new KxsUserModels.KxsUser();
|
|
|
List<ProfitResult> list = new List<ProfitResult>();
|
|
|
- list = StartProft(TotalAmount, 1, users, IsActive);
|
|
|
+ list = StartProft(TotalAmount, 1, users, WenDing, IsActive);
|
|
|
try
|
|
|
{
|
|
|
foreach (ProfitResult sub in list)
|
|
|
@@ -169,7 +170,7 @@ namespace MySystem
|
|
|
|
|
|
|
|
|
#region 分润算法
|
|
|
- public List<ProfitResult> StartProft(decimal TotalAmount, int LevelKindId, List<ProfitUsers> users, bool IsActive = true)
|
|
|
+ public List<ProfitResult> StartProft(decimal TotalAmount, int LevelKindId, List<ProfitUsers> users, bool WenDing, bool IsActive = true)
|
|
|
{
|
|
|
LogHelper.Instance.WriteLog("\n\nTotalAmount:" + TotalAmount + ";", "来客吧分润日志");
|
|
|
string Month = DateTime.Now.AddMonths(-1).ToString("yyyyMM");
|
|
|
@@ -213,6 +214,7 @@ namespace MySystem
|
|
|
{
|
|
|
decimal getLevelProfit = 0; //等级分润
|
|
|
UserProfitSet profitSet = new UserProfitSet();
|
|
|
+ if(WenDing) objlevel.Percents = objlevel.Percents * 0.8M;
|
|
|
decimal profitPercent = IsActive ? objlevel.DebitPercents : objlevel.Percents;
|
|
|
LogHelper.Instance.WriteLog("money:" + UserLevel + ":" + profitPercent + ";", "来客吧分润日志");
|
|
|
if (profitPercent > 0)
|