@ -19,9 +19,15 @@ class MemberController extends ThinkController
if($_REQUEST['promote_id']=='UC'){
if($_REQUEST['promote_id']=='UC'){
$maps['tab_user.promote_account'] = 'UC用户';
$maps['tab_user.promote_account'] = 'UC用户';
$hav .= "tab_user.promote_account = 'UC用户' ";
$hav .= "tab_user.promote_account = 'UC用户' ";
} else if ($_REQUEST['promote_id']==0) {
$maps['tab_user.promote_id'] = 0;
$hav .= "tab_user.promote_id = 0";
} else{
} else{
$maps['tab_user.promote_id'] = I('promote_id');
$promoter_ids = D("Promote")->where("parent_id={$_REQUEST['promote_id']} or grand_id={$_REQUEST['promote_id']} or id={$_REQUEST['promote_id']}")->field('id')->select();
$hav .= "tab_user.promote_id in (".implode(',', array_column($promoter_ids, 'id')).") ";
}
}
}
}
}
if(I('type',1) == 1){
if(I('type',1) == 1){
@ -57,7 +63,6 @@ class MemberController extends ThinkController
}
}
}
}
if (isset($_REQUEST['account'])) {
if (isset($_REQUEST['account'])) {
empty($hav) || $hav .= ' AND ';
empty($hav) || $hav .= ' AND ';
$hav .= "tab_user.account like '%" . I('account') . "%'";
$hav .= "tab_user.account like '%" . I('account') . "%'";
@ -159,12 +164,12 @@ class MemberController extends ThinkController
$data = $usermodel->table('('.$sql1.') as a ')->field('a.id,a.device_number,a.age_status,a.account,a.balance,a.gold_coin,a.alipay,a.promote_id,a.register_type,a.promote_account,a.register_time,a.lock_status,a.register_way,a.register_type,a.register_ip,a.login_time,(a.deposit_total+IFNULL(sum(ss.pay_amount),0)) as recharge_total,check_status')
$data = $usermodel->table('('.$sql1.') as a ')->field('a.id,a.device_number,a.age_status,a.account,a.balance,a.gold_coin,a.alipay,a.promote_id,a.register_type,a.promote_account,a.register_time,a.lock_status,a.register_way,a.register_type,a.register_ip,a.login_time,(a.deposit_total+IFNULL(sum(ss.pay_amount),0)) as recharge_total,check_status')
->join('left join tab_spend as ss on ss.user_id=a.id AND ss.pay_status = 1')
->join('left join tab_spend as ss on ss.user_id=a.id AND ss.pay_status = 1')
->join(isset($_REQUEST['game_id']) ? "tab_user_play as up on up.user_id = a.id and up.game_id = {$_REQUEST['game_id']} " : false)
->page($page, $row)
->page($page, $row)
->having($havs)
->having($havs)
->group('a.id')
->group('a.id')
->order($order)
->order($order)
->select();
->select();
// var_dump($data);die;
// var_dump($data);die;
//计数
//计数
@ -172,6 +177,7 @@ class MemberController extends ThinkController
$sql = M('user', 'tab_')->field('tab_user.id,(IFNULL(sum(b.pay_amount),0) + IFNULL(sum(ss.pay_amount),0)) AS recharge_total')
$sql = M('user', 'tab_')->field('tab_user.id,(IFNULL(sum(b.pay_amount),0) + IFNULL(sum(ss.pay_amount),0)) AS recharge_total')
->join('left join tab_deposit AS b ON tab_user.id = b.user_id AND b.pay_status = 1')
->join('left join tab_deposit AS b ON tab_user.id = b.user_id AND b.pay_status = 1')
->join('left join tab_spend as ss on ss.user_id=tab_user.id AND ss.pay_status = 1')
->join('left join tab_spend as ss on ss.user_id=tab_user.id AND ss.pay_status = 1')
->join(isset($_REQUEST['game_id']) ? "tab_user_play as up on up.user_id = tab_user.id and up.game_id = {$_REQUEST['game_id']} " : false)
$promoter_ids = D("Promote")->where("parent_id={$_REQUEST['promote_id']} or grand_id={$_REQUEST['promote_id']} or id={$_REQUEST['promote_id']}")->field('id')->select();
@ -569,6 +569,11 @@ function think_ucenter_md5($str, $key = 'ThinkUCenter'){
$map['role_name'] = trim($_REQUEST['role_name']);
$map['role_name'] = trim($_REQUEST['role_name']);
unset($_REQUEST['role_name']);
unset($_REQUEST['role_name']);
}
}
if (isset($_REQUEST['promote_id'])) {
$promoter_ids = D("Promote")->where("parent_id={$_REQUEST['promote_id']} or grand_id={$_REQUEST['promote_id']} or id={$_REQUEST['promote_id']}")->field('id')->select();