|
|
@@ -123,9 +123,11 @@ namespace MySystem
|
|
|
|
|
|
//计算创客名下的达标人数,直推和间接
|
|
|
function.WriteLog("MonthString:" + MonthString, "领导人达标奖励日志");
|
|
|
+
|
|
|
+ Thread.Sleep(300000);
|
|
|
|
|
|
// List<LeaderCompTradeStat> stats = db.LeaderCompTradeStat.Where(m => m.StatMonth == MonthString).ToList();
|
|
|
- DataTable stats = CustomerSqlConn.dtable("select UserId,ParentUserId,ParentNav,TradeAmount,(select sum(TradeAmount) from LeaderCompTradeStat where ParentUserId=p.UserId and TradeAmount<30000000) SmallTradeAmount from LeaderCompTradeStat p where StatMonth='" + MonthString + "' and UserId>1", MysqlConn.SqlConnStr);
|
|
|
+ DataTable stats = CustomerSqlConn.dtable("select UserId,ParentUserId,ParentNav,TradeAmount,(select sum(TradeAmount) from LeaderCompTradeStat where ParentUserId=p.UserId and TradeAmount<30000000) SmallTradeAmount from LeaderCompTradeStat p where StatMonth='" + MonthString + "' and UserId>1", MysqlConn.ReadSqlConnStr);
|
|
|
function.WriteLog(stats.Rows.Count.ToString(), "领导人达标奖励日志");
|
|
|
foreach(DataRow stat in stats.Rows)
|
|
|
{
|
|
|
@@ -196,7 +198,7 @@ namespace MySystem
|
|
|
{
|
|
|
string MonthFlag = month + "-" + checkDate;
|
|
|
WebCMSEntities db = new WebCMSEntities();
|
|
|
- DataTable dt = CustomerSqlConn.dtable("select ParentUserId,ParentNav,count(1) from LeaderCompTmp where SUBSTR(EveryMonthData,1,1)='1' GROUP BY ParentUserId,ParentNav", MysqlConn.SqlConnStr);
|
|
|
+ DataTable dt = CustomerSqlConn.dtable("select ParentUserId,ParentNav,count(1) from LeaderCompTmp where SUBSTR(EveryMonthData,1,1)='1' GROUP BY ParentUserId,ParentNav", MysqlConn.ReadSqlConnStr);
|
|
|
foreach(DataRow dr in dt.Rows)
|
|
|
{
|
|
|
int ParentUserId = int.Parse(function.CheckInt(dr["ParentUserId"].ToString()));
|
|
|
@@ -214,7 +216,7 @@ namespace MySystem
|
|
|
db.SaveChanges();
|
|
|
}
|
|
|
edit.DirectCount = Count; //达标市场
|
|
|
- DataTable dtsub = CustomerSqlConn.dtable("select SUBSTRING_INDEX(SUBSTRING_INDEX(REPLACE(ParentNav, '" + ParentNav + "', ''),',',2),',',-1),count(1) from LeaderCompTmp where ParentUserId!=" + ParentUserId + " and ParentNav like '%," + ParentUserId + ",%' and SUBSTR(EveryMonthData,2,1)='2' group by SUBSTRING_INDEX(SUBSTRING_INDEX(REPLACE(ParentNav, '" + ParentNav + "', ''),',',2),',',-1)", MysqlConn.SqlConnStr);
|
|
|
+ DataTable dtsub = CustomerSqlConn.dtable("select SUBSTRING_INDEX(SUBSTRING_INDEX(REPLACE(ParentNav, '" + ParentNav + "', ''),',',2),',',-1),count(1) from LeaderCompTmp where ParentUserId!=" + ParentUserId + " and ParentNav like '%," + ParentUserId + ",%' and SUBSTR(EveryMonthData,2,1)='2' group by SUBSTRING_INDEX(SUBSTRING_INDEX(REPLACE(ParentNav, '" + ParentNav + "', ''),',',2),',',-1)", MysqlConn.ReadSqlConnStr);
|
|
|
foreach(DataRow drsub in dtsub.Rows)
|
|
|
{
|
|
|
int SubCount = int.Parse(function.CheckInt(drsub[1].ToString()));
|