|
|
@ -649,22 +649,13 @@ class PromoteCoinController extends BaseController
|
|
|
|
$map = ['chain' => ['like', $promote['chain'] . $promote['id'] . '/%']];
|
|
|
|
$map = ['chain' => ['like', $promote['chain'] . $promote['id'] . '/%']];
|
|
|
|
$promoteIds = D('Promote')->field('id')->where($map)->getField('id', true);
|
|
|
|
$promoteIds = D('Promote')->field('id')->where($map)->getField('id', true);
|
|
|
|
$promoteIds[] = $id;
|
|
|
|
$promoteIds[] = $id;
|
|
|
|
$rows = D('UserPlay')->field(['id', 'user_id'])->where(['promote_id' => ['in', $promoteIds]])->select();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$map = [];
|
|
|
|
|
|
|
|
$userIds = array_column($rows, 'user_id');
|
|
|
|
|
|
|
|
if (count($userIds) > 0) {
|
|
|
|
|
|
|
|
$map = ['id' => ['in', array_column($rows, 'user_id')]];
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
$map = ['_string' => '1<>1'];
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if ($account) {
|
|
|
|
if ($account) {
|
|
|
|
$map['account'] = ['like', '%' . $account . '%'];
|
|
|
|
$map['account'] = ['like', '%' . $account . '%'];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if ($mobile) {
|
|
|
|
if ($mobile) {
|
|
|
|
$map['mobile_phone'] = ['like', '%' . $mobile . '%'];
|
|
|
|
$map['mobile_phone'] = ['like', '%' . $mobile . '%'];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
$map['promote_id'] = ['in',$promoteIds];
|
|
|
|
$query = M('User', 'tab_')->field(['id', 'phone', 'account', 'real_name'])->where($map);
|
|
|
|
$query = M('User', 'tab_')->field(['id', 'phone', 'account', 'real_name'])->where($map);
|
|
|
|
|
|
|
|
|
|
|
|
list($users, $pagination, $count) = $this->paginate($query);
|
|
|
|
list($users, $pagination, $count) = $this->paginate($query);
|
|
|
|