Merge branch 'release-1.0.0' of 47.111.118.107:wmtx/platform into release_zyx

master
zhengyongxing 5 years ago
commit 8f1847341f

@ -1706,12 +1706,25 @@ function get_admin_listOther()
* @param $promote_id
* @return mixed
*/
function getOffspringByPromoteId($promote_id) {
$promote_ids = M('promote', 'tab_')
->where(['chain' => ['like', "%/{$promote_id}/%"]])
->field('group_concat(id) as promote_ids')
->find();
return $promote_ids['promote_ids'];
function getOffspringByPromoteId($promote_id = null) {
if (isset($promote_id)) {
if ($promote_id ==0) {//官方渠道
$promote_ids = '0';
} else {
$where['chain'] = ['like', "%/{$promote_id}/%"];
$where['id'] = $promote_id;//会长本身
$where['_logic'] = 'or';
$map['_complex'] = $where;
$promote_ids = M('promote', 'tab_')
->where($map)
->field('group_concat(id) as promote_ids')
->find();
$promote_ids = $promote_ids['promote_ids'];
}
} else {
$promote_ids = getPowerPromoteIds();
}
return $promote_ids;
}

@ -1072,21 +1072,22 @@ class MemberController extends ThinkController
if (isset($_REQUEST['promote_id'])) {
if (I('promote_level') ==1) {
$promote_ids = getOffspringByPromoteId($_REQUEST['promote_id']);
if (empty($promote_ids)) {
$promote_ids = -1;
}
$map['promote_id'] = ['exp', "in($promote_ids)"];
} else {
$map['promote_id'] = $_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['login_time'] = ['exp', 'login_time<>0'];
$extend = array();
$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";
$count = M('UserLoginRecord','tab_')->query($sql);

@ -394,7 +394,11 @@
location.reload();
}, 1500);
} else {
var tip_msg = e.msg ? e.msg : "补单失败";
if (e.msg) {
var tip_msg = e.msg;
} else {
var tip_msg = e.info ? e.info : "补单失败";
}
layer.msg(tip_msg, {icon: 2});
}
},

Loading…
Cancel
Save