|
@@ -71,6 +71,7 @@ namespace MySystem
|
|
{
|
|
{
|
|
WebCMSEntities db = new WebCMSEntities();
|
|
WebCMSEntities db = new WebCMSEntities();
|
|
string MonthString = month;
|
|
string MonthString = month;
|
|
|
|
+ string Now = DateTime.Parse(month.Substring(0, 4) + "-" + month.Substring(4, 2) + "-01 00:00:00").AddMonths(1).ToString("yyyy-MM-dd HH:mm:ss");
|
|
string PreMonthString = DateTime.Parse(month.Substring(0, 4) + "-" + month.Substring(4, 2) + "-01 00:00:00").AddMonths(-1).ToString("yyyyMM");
|
|
string PreMonthString = DateTime.Parse(month.Substring(0, 4) + "-" + month.Substring(4, 2) + "-01 00:00:00").AddMonths(-1).ToString("yyyyMM");
|
|
|
|
|
|
//统计交易增量
|
|
//统计交易增量
|
|
@@ -81,7 +82,7 @@ namespace MySystem
|
|
int rownum = 0;
|
|
int rownum = 0;
|
|
int num = 0;
|
|
int num = 0;
|
|
List<LeaderCompUser> UserData = new List<LeaderCompUser>();
|
|
List<LeaderCompUser> UserData = new List<LeaderCompUser>();
|
|
- string rootsql = "select tb.user_id,pid,pid_path,leader_type,trade_amt,act_trade_amt,unact_trade_amt from (select user_id,sum(if(brand_id not in (18,19,20,21,29,23,24,25,26,32,101,100),help_direct_trade_amt+pro_direct_trade_amt+pro_a_direct_trade_amt+pro_b_direct_trade_amt,0)) trade_amt,sum(if(brand_id in (101,100,18,19,20,21,29),help_direct_trade_amt,0))*4 act_trade_amt,sum(if(brand_id in (101,100,18,19,20,21,29),pro_direct_trade_amt,0)) unact_trade_amt from kxs_user_trade_" + month + " where total_type=1 group by user_id) tb LEFT JOIN kxs_user.kxs_user u on tb.user_id=u.id LEFT JOIN kxs_user.kxs_leader l on tb.user_id=l.id and l.expired_date>now()";
|
|
|
|
|
|
+ string rootsql = "select tb.user_id,pid,pid_path,leader_type,trade_amt,act_trade_amt,unact_trade_amt from (select user_id,sum(if(brand_id not in (18,19,20,21,29,23,24,25,26,32,101,100),help_direct_trade_amt+pro_direct_trade_amt+pro_a_direct_trade_amt+pro_b_direct_trade_amt,0)) trade_amt,sum(if(brand_id in (101,100,18,19,20,21,29),help_direct_trade_amt,0))*4 act_trade_amt,sum(if(brand_id in (101,100,18,19,20,21,29),pro_direct_trade_amt,0)) unact_trade_amt from kxs_user_trade_" + month + " where total_type=1 group by user_id) tb LEFT JOIN kxs_user.kxs_user u on tb.user_id=u.id LEFT JOIN kxs_user.kxs_leader l on tb.user_id=l.id and l.expired_date>'" + Now + "'";
|
|
function.WriteLog(rootsql, "领导人达标奖励日志");
|
|
function.WriteLog(rootsql, "领导人达标奖励日志");
|
|
DataTable dt = CustomerSqlConn.dtable(rootsql, MysqlConn.JavaStatSqlConnStr);
|
|
DataTable dt = CustomerSqlConn.dtable(rootsql, MysqlConn.JavaStatSqlConnStr);
|
|
foreach(DataRow dr in dt.Rows)
|
|
foreach(DataRow dr in dt.Rows)
|