|
|
- 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 + "'";
|