@ -1072,21 +1072,22 @@ class MemberController extends ThinkController
if (isset($_REQUEST['promote_id'])) {
if (isset($_REQUEST['promote_id'])) {
if (I('promote_level') ==1) {
if (I('promote_level') ==1) {
$promote_ids = getOffspringByPromoteId($_REQUEST['promote_id']);
$promote_ids = getOffspringByPromoteId($_REQUEST['promote_id']);
if (empty($promote_ids)) {
$promote_ids = -1;
}
$map['promote_id'] = ['exp', "in($promote_ids)"];
$map['promote_id'] = ['exp', "in($promote_ids)"];
} else {
} else {
$map['promote_id'] = $_REQUEST['promote_id'];
$map['promote_id'] = $_REQUEST['promote_id'];
}
}
unset($_REQUEST['promote_id']);
unset($_REQUEST['promote_id']);
} elseif (I('promote_level') ==1) {
$promote_ids = getOffspringByPromoteId();
if ($promote_ids != 'all') {
$map['promote_id'] = ['exp', "in($promote_ids)"];
}
}
}
// $map['type'] = 1;
// $map['type'] = 1;
// $map['login_time'] = ['exp', 'login_time< >0'];
// $map['login_time'] = ['exp', 'login_time< >0'];
$extend = array();
$extend = array();
$extend['map'] = $map;
$extend['map'] = $map;
$count = M('UserLoginRecord','tab_')->field('user_id')->where($extend['map'])->group('user_id')->select(false);
$count = M('UserLoginRecord','tab_')->table('tab_user_login_record FORCE INDEX(user_id_promote_idx)')-> field('user_id')->where($extend['map'])->group('user_id')->select(false);
$sql = "select count(user_id) as count from ({$count})t";
$sql = "select count(user_id) as count from ({$count})t";
$count = M('UserLoginRecord','tab_')->query($sql);
$count = M('UserLoginRecord','tab_')->query($sql);