|
|
@ -130,20 +130,19 @@ class MemberController extends ThinkController
|
|
|
|
|
|
|
|
|
|
|
|
//如股存在会长计算换绑定记录
|
|
|
|
//如股存在会长计算换绑定记录
|
|
|
|
if($promoterSelect){
|
|
|
|
if($promoterSelect){
|
|
|
|
|
|
|
|
$maps = $map;
|
|
|
|
|
|
|
|
unset($maps['tab_user.promote_id']);
|
|
|
|
$history_count = M("user","tab_")
|
|
|
|
$history_count = M("user","tab_")
|
|
|
|
->field("IFNULL(sum(ss.pay_amount), 0) AS recharge_total")
|
|
|
|
->field("IFNULL(sum(ss.pay_amount), 0) AS recharge_total")
|
|
|
|
->join("tab_spend AS ss ON ss.user_id = tab_user.id AND ss.pay_status = 1".$spendprom,"left")
|
|
|
|
->join("tab_spend AS ss ON ss.user_id = tab_user.id AND ss.pay_status = 1".$spendprom,"left")
|
|
|
|
->where($map);
|
|
|
|
->where($maps);
|
|
|
|
if($havs){
|
|
|
|
if($havs){
|
|
|
|
$history_count->having($havs);
|
|
|
|
$history_count->having($havs);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$history_count = $history_count->find()['recharge_total'];
|
|
|
|
$history_count = $history_count->find()['recharge_total'];
|
|
|
|
$this->assign('history_count', $history_count?:0);
|
|
|
|
$this->assign('history_count', $history_count?:0);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// dump($countsql);die();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// $countres = M()->table('(' . $countsql . ') as a ')->field("count(*) user_count,sum(recharge_total) recharge_total")->find();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$this->assign('user_count',$user_count);
|
|
|
|
$this->assign('user_count',$user_count);
|
|
|
|
$this->assign('now_count', $now_count?:0);
|
|
|
|
$this->assign('now_count', $now_count?:0);
|
|
|
|