Merge branch 'dev' of 47.111.118.107:/srv/git/platform into dev

master
zhanglingsheng 5 years ago
commit 391eed0b78

@ -98,7 +98,7 @@ class ExportController extends Controller
}
$xlsData = M('user_play_info', 'tab_')
->where($map)
->order('id desc')
->order('play_time desc')
->select();
break;
case 2:
@ -197,185 +197,335 @@ class ExportController extends Controller
break;
case 3:
if($_REQUEST['type']==2){
$xlsCell = array(
array('id', L('Account_number_ID')),
array('register_type', L('Third_party_source'), "get_registertype", '*'),
array('account', "玩家账号"),
array('promote_account', L('Subordinate_channel')),
array('balance', "账户平台币"),
array('recharge_total', "累计充值"),
array('gold_coin', "金币"),
array('alipay', "绑定支付宝"),
array('small_count', "小号"),
array('vip_level', "VIP等级"),
array('register_time', L('Registration_time'), 'time_format', '*'),
array('login_time', "最后登录时间", 'time_format', '*'),
array('register_ip', L('Register_iP')),
array('lock_status', L('Account_status'), 'get_info_status', '*', '4'),
);
// $xlsCell = array(
// array('id', L('Account_number_ID')),
// array('register_type', L('Third_party_source'), "get_registertype", '*'),
// array('account', "玩家账号"),
// array('promote_account', L('Subordinate_channel')),
// array('balance', "账户平台币"),
// array('recharge_total', "累计充值"),
// array('gold_coin', "金币"),
// array('alipay', "绑定支付宝"),
// array('small_count', "小号"),
// array('vip_level', "VIP等级"),
// array('register_time', L('Registration_time'), 'time_format', '*'),
// array('login_time', "最后登录时间", 'time_format', '*'),
// array('register_ip', L('Register_iP')),
// array('lock_status', L('Account_status'), 'get_info_status', '*', '4'),
// );
$field = 'a.id,a.account,a.id as get_registertype,a.promote_account,a.balance,IFNULL(sum(ss.pay_amount),0) as recharge_total,
a.gold_coin,a.alipay,a.id as small_count,a.id as vip_level,a.register_type,a.register_time
,a.register_ip,a.login_time,a.device_number,a.lock_status,check_status,a.age_status,a.register_way,
a.register_type';
$xlsCell = [L('Account_number_ID'),"第三方来源","绑定账号",L('Subordinate_channel'), "账户平台币"
, "累计充值", "金币", "绑定支付宝", "小号", "VIP等级", L('Registration_time'),
L('Register_iP'), "最后登录时间","设备号", L('Account_status'),"拉黑状态"];
$map['tab_user.register_type']= ['in','3,4,5,6'];
}else{
$xlsCell = array(
array('id', L('Account_number_ID')),
array('account', "玩家账号"),
array('promote_account', L('Subordinate_channel')),
array('balance', "账户平台币"),
array('recharge_total', "累计充值"),
array('gold_coin', "金币"),
array('alipay', "绑定支付宝"),
array('small_count', "小号"),
array('vip_level', "VIP等级"),
array('register_type', "注册方式"),
array('register_time', L('Registration_time'), 'time_format', '*'),
array('login_time', "最后登录时间", 'time_format', '*'),
array('register_ip', L('Register_iP')),
array('lock_status', L('Account_status'), 'get_info_status', '*', '4'),
);
// $xlsCell = array(
// array('id', L('Account_number_ID')),
// array('account', "玩家账号"),
// array('promote_account', L('Subordinate_channel')),
// array('balance', "账户平台币"),
// array('recharge_total', "累计充值"),
// array('gold_coin', "金币"),
// array('alipay', "绑定支付宝"),
// array('small_count', "小号"),
// array('vip_level', "VIP等级"),
// array('register_type', "注册方式"),
// array('register_time', L('Registration_time'), 'time_format', '*'),
// array('login_time', "最后登录时间", 'time_format', '*'),
// array('register_ip', L('Register_iP')),
// array('lock_status', L('Account_status'), 'get_info_status', '*', '4'),
// );
$field = 'a.id,a.account,a.promote_account,a.balance,IFNULL(sum(ss.pay_amount),0) as recharge_total,
a.gold_coin,a.alipay,a.id as small_count,a.id as vip_level,a.register_type,a.register_time
,a.register_ip,a.login_time,a.device_number,a.lock_status,check_status,a.age_status,a.register_way,
a.register_type';
$xlsCell = [L('Account_number_ID'),"玩家账号",L('Subordinate_channel'), "账户平台币"
, "累计充值", "金币", "绑定支付宝", "小号", "VIP等级", "注册方式", L('Registration_time'),
L('Register_iP'), "最后登录时间","设备号", L('Account_status'),"拉黑状态"];
$map['tab_user.register_type']=['in','1,2'];
$map['tab_user.register_type']=['in','0,1,2,7'];
}
if (isset($_REQUEST['user_id'])) {
$map['tab_user.id'] = $_REQUEST['user_id'];
unset($_REQUEST['user_id']);
}
if (isset($_REQUEST['device_number'])) {
$map['tab_user.device_number'] = $_REQUEST['device_number'];
unset($_REQUEST['device_number']);
}
$hav = '';
if ($_REQUEST['promote_id'] != '') {
if($_REQUEST['promote_id']=='UC'){
$map['tab_user.promote_account'] = 'UC用户';
} else if ($_REQUEST['promote_id']==0) {
$map['tab_user.promote_id'] = 0;
} else{
if ($_REQUEST['promote_id'] == 'UC') {
$maps['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 {
$promoter_ids = D("Promote")->where("chain like '%/{$_REQUEST['promote_id']}/%' or id={$_REQUEST['promote_id']}")->field('id')->select();
if ($promoter_ids) {
$map['tab_user.promote_id'] = ['in', implode(',', array_column($promoter_ids, 'id'))];
$maps['tab_user.promote_id'] = ['in', implode(',', array_column($promoter_ids, 'id'))];
$hav .= "tab_user.promote_id in (" . implode(',', array_column($promoter_ids, 'id')) . ") ";
$spendprom = " AND ss.promote_id IN (" . implode(',', array_column($promoter_ids, 'id')) . ") ";
}
}
}
$game_map = "";
if (isset($_REQUEST['game_name'])) {
$game_map .= " and tab_user_play.game_id in (".implode(',', array_column(getGameByName($_REQUEST['game_name'], $_REQUEST['game_type']), 'id')).")";
}
$game_play_map = '';
if (isset($_REQUEST['server_name'])) {
$game_play_map .= " and tab_user_play_info.server_name = '{$_REQUEST['server_name']}' ";
}
// if (isset($_REQUEST['promote_account'])) {
// $map['promote_id'] = get_promote_id(trim(I('promote_account')));
// unset($_REQUEST['promote_account']);
// }
if (isset($_REQUEST['register_way'])) {
if($_REQUEST['type']==1) {
if (I('type', 1) == 1) {
if (isset($_GET['register_way'])) {
if ($_GET['register_way'] == 1) {
empty($hav) || $hav .= ' AND ';
$hav .= ' tab_user.register_type in (0,1)';
$maps['tab_user.register_type'] = ['in',[0,1]];
} elseif($_GET['register_way'] == 7){
empty($hav) || $hav .= ' AND ';
$hav .= ' tab_user.register_type in(7)';
$maps['tab_user.register_type'] = 7;
}else {
empty($hav) || $hav .= ' AND ';
$hav .= ' tab_user.register_type in(2)';
$maps['tab_user.register_type'] = 2;
empty($hav) || $hav .= ' AND ';
$hav .= ' tab_user.register_type in (1)';
$maps['tab_user.register_type'] = 1;
} elseif ($_GET['register_way'] == 7) {
empty($hav) || $hav .= ' AND ';
$hav .= ' tab_user.register_type in(7)';
$maps['tab_user.register_type'] = 7;
} else {
empty($hav) || $hav .= ' AND ';
$hav .= ' tab_user.register_type in(2)';
$maps['tab_user.register_type'] = 2;
}
} else {
$map['register_way'] = I('register_way');
unset($_REQUEST['register_way']);
empty($hav) || $hav .= ' AND ';
$hav .= ' tab_user.register_type in (1,2,7)';
$maps['tab_user.register_type'] = ['in', [1, 2, 7]];
}
} else {
if (isset($_GET['register_type'])) {
empty($hav) || $hav .= ' AND ';
$hav .= ' tab_user.register_type = ' . $_GET['register_type'];
$maps['tab_user.register_type'] = $_GET['register_type'];
} else {
empty($hav) || $hav .= ' AND ';
$hav .= ' tab_user.register_type in (0,3,4,5,6)';
$maps['tab_user.register_type'] = ['in', [0, 3, 4, 5, 6]];
}
}
if (isset($_REQUEST['register_type'])) {
$map['register_type'] = I('register_type');
unset($_REQUEST['register_type']);
if (isset($_REQUEST['user_id'])) {
empty($hav) || $hav .= ' AND ';
$hav .= "tab_user.id = '{$_REQUEST['user_id']}'";
$maps['tab_user.id'] = $_REQUEST['user_id'];
unset($_REQUEST['user_id']);
}
if (isset($_REQUEST['status'])) {
$map['lock_status'] = I('status');
unset($_REQUEST['status']);
if (isset($_REQUEST['account'])) {
empty($hav) || $hav .= ' AND ';
$hav .= "tab_user.account like '%" . I('account') . "%'";
$maps['tab_user.account'] = ['like', "%" . I('account') . "%"];
unset($_REQUEST['account']);
}
if (!empty(I('time_start')) && !empty(I('time_end'))) {
$map['register_time'] = array('BETWEEN', array(strtotime(I('get.time_start')), strtotime(I('time_end')) + 24 * 60 * 60 - 1));
if (isset($_REQUEST['device_number'])) {
empty($hav) || $hav .= ' AND ';
$hav .= "tab_user.device_number = '{$_REQUEST['device_number']}'";
$maps['tab_user.device_number'] = $_REQUEST['device_number'];
unset($_REQUEST['device_number']);
}
if (isset($_REQUEST['age_status'])) {
empty($hav) || $hav .= ' AND ';
$hav .= 'tab_user.age_status =' . I('age_status');
$maps['tab_user.age_status'] = I('age_status');
unset($_REQUEST['age_status']);
}
if (isset($_REQUEST['time_start']) && isset($_REQUEST['time_end'])) {
empty($hav) || $hav .= ' AND ';
$hav .= 'tab_user.register_time BETWEEN ' . strtotime(I('time_start')) . ' AND ' . (strtotime(I('time_end')) + 24 * 60 * 60 - 1);
$maps['tab_user.register_time'] = ['between', [strtotime(I('time_start')), strtotime(I('time_end')) + 86399]];
unset($_REQUEST['time_start']);
unset($_REQUEST['time_end']);
} elseif (isset($_REQUEST['time_start'])) {
empty($hav) || $hav .= ' AND ';
$hav .= 'tab_user.register_time > ' . strtotime(I('time_start'));
$maps['tab_user.register_time'] = ['GT', strtotime(I('time_start'))];
unset($_REQUEST['time_start']);
} elseif (isset($_REQUEST['time_end'])) {
empty($hav) || $hav .= ' AND ';
$hav .= 'tab_user.register_time < ' . (strtotime(I('time_end')) + 86399);
$maps['tab_user.register_time'] = ['LT', strtotime(I('time_end')) + 86399];
unset($_REQUEST['time_end']);
}
empty(I('account')) || $map['account'] = ['like', '%' . I('account') . '%'];
//排序
if (I('total_status') == 1) {
$order = 'cumulative asc';
} elseif (I('total_status') == 2) {
$order = 'cumulative desc';
} else {
$order = 'id desc';
if (isset($_REQUEST['start']) && isset($_REQUEST['end'])) {
empty($hav) || $hav .= ' AND ';
$hav .= 'tab_user.register_time BETWEEN ' . strtotime(I('start')) . ' AND ' . strtotime(I('end'));
$maps['tab_user.register_time'] = array('between', [strtotime(I('start')), strtotime(I('end'))]);
unset($_REQUEST['start']);
unset($_REQUEST['end']);
}
if (!empty(I('line_day'))) {
$day = strtotime(date('Y-m-d')) - intval(I('line_day')) * 86400;
empty($hav) || $hav .= ' AND ';
$hav .= $day . '> tab_user.login_time';
$maps['tab_user.login_time'] = ['lt', $day];
}
if (isset($_REQUEST['status'])) {
$map['lock_status'] = $_REQUEST['status'];
unset($_REQUEST['status']);
}
// if (isset($_REQUEST['game_name'])) {
// //$game_map .= " and tab_user_play.game_id in (" . implode(',', array_column(getGameByName($_REQUEST['game_name'], $_REQUEST['game_type']), 'id')) . ")";
// }
$spendprom = " and ss.game_id in (".implode(',', array_column(getGameByName($_REQUEST['game_name'], $_REQUEST['game_type']), 'id')).")";
if (isset($_REQUEST['server_name'])) {
$map['server_name'] = ['like', "{$_REQUEST['server_name']}%"];
}
if (isset($_REQUEST['viplevel'])) {
$havs = get_vip_level_limit('recharge_total',$_REQUEST['viplevel']);
$havs = get_vip_level_limit('recharge_total', $_REQUEST['viplevel']);
}
$map['puid'] = array('eq',0);
//排序
$order = '';
if (I('key') == 1) {
if (I('balance_status') == 1) {
$order = 'balance,';
} elseif (I('balance_status') == 2) {
$order = 'balance desc,';
}
} else {
if (I('recharge_status') == 1) {
$order .= 'recharge_total,';
} elseif (I('recharge_status') == 2) {
$order .= 'recharge_total desc,';
}
}
$order .= 'a.id desc';
$user = M('user', 'tab_');
$map['puid'] = array('eq', 0);
$map['is_platform'] = 0;
if($_REQUEST['promote_id'] && $_REQUEST['promote_id'] > -1){
$xlsData = M('user', 'tab_')->field('tab_user.id,tab_user.age_status,tab_user.account,tab_user.gold_coin,tab_user.alipay,tab_user.balance,tab_user.promote_account,register_time,tab_user.lock_status,tab_user.register_way,tab_user.register_type,tab_user.register_ip,tab_user.login_time,IFNULL(sum(ss.pay_amount),0) AS recharge_total')
->join('left join tab_spend as ss on ss.user_id=tab_user.id AND ss.pay_status = 1'.$spendprom)
->join($game_map ? "tab_user_play on tab_user_play.user_id = tab_user.id $game_map" : false)
->join($game_play_map ? "tab_user_play_info on tab_user_play_info.user_id = tab_user.id $game_play_map" : false)
$usermodel = M('user', 'tab_');
$sql1 = $usermodel->field('tab_user.*,IFNULL(sum(b.pay_amount),0) as deposit_total')
->join('left join tab_deposit AS b ON tab_user.id = b.user_id AND b.pay_status = 1')
->where($map)
->group('tab_user.id')
->order($order)
->having($havs)
->select();
}else{
$xlsData = M('user', 'tab_')->field('tab_user.id,tab_user.age_status,tab_user.account,tab_user.gold_coin,tab_user.alipay,tab_user.balance,tab_user.promote_account,register_time,tab_user.lock_status,tab_user.register_way,tab_user.register_type,tab_user.register_ip,tab_user.login_time,IFNULL(sum(ss.pay_amount),0) AS recharge_total')
->join('left join tab_spend as ss on ss.user_id=tab_user.id AND ss.pay_status = 1')
->join($game_map ? "tab_user_play on tab_user_play.user_id = tab_user.id $game_map" : false)
->join($game_play_map ? "tab_user_play_info on tab_user_play_info.user_id = tab_user.id $game_play_map" : false)
->where($hav)
// ->order($order)
->select(false);
set_time_limit(0);
// $columns = [
// '序号ID', '姓名', '电话',
// ];
$fileName = '导出.xlsx';
$csvFileName = $xlsName.'.csv';
//设置好告诉浏览器要下载excel文件的headers
header('Content-Description: File Transfer');
header('Content-Type: application/vnd.ms-excel');
header('Content-Disposition: attachment; filename="'. $csvFileName .'"');
header('Expires: 0');
header('Cache-Control: must-revalidate');
header('Pragma: public');
$fp = fopen('php://output', 'a');//打开output流
mb_convert_variables('GBK', 'UTF-8', $xlsCell);
fputcsv($fp, $xlsCell);//将数据格式化为CSV格式并写入到output流中
$accessNum = '100000';//从数据库获取总量,假设是十万
//计数
$sql = M('user', 'tab_')->field('tab_user.id,IFNULL(sum(ss.pay_amount),0) AS recharge_total')
->join('left join tab_spend as ss on ss.user_id=tab_user.id AND ss.pay_status = 1'.$spendprom)
->where($map)
->group('tab_user.id')
->order($order)
->having($havs)
->select();
->where($hav)
->having($havs)->select(false);
//替换为新表
if($_REQUEST['promote_id'] && $_REQUEST['promote_id'] > -1){
$sql = M('user', 'tab_')->field('tab_user.id,IFNULL(sum(ss.pay_amount),0) AS recharge_total')
->join('left join tab_spend as ss on ss.user_id=tab_user.id AND ss.pay_status = 1'.$spendprom)
->where($map)
->group('tab_user.id')
->where($hav)
->having($havs)->select(false);
}
//数据
if($xlsData) {
$ids = array_column($xlsData,'id');
/* 在手里 */
$small = M('user','tab_')->field('count(id) as count,puid')->where(['puid'=>array('in',$ids)])->group('puid')->select();
/* 出售中 */
$small2 = M('user','tab_')->field('count(id) as count,source_puid')->where(['source_puid'=>array('in',$ids),'source_time'=>0])->group('source_puid')->select();
foreach($xlsData as $k => $v) {
$xlsData[$k]['vip_level'] = get_vip_level($v['recharge_total']);
if(empty($v['alipay'])){
$xlsData[$k]['alipay'] = '--';
}
$xlsData[$k]['register_type'] = $v['register_type'] == 2?'手机号':($v['register_type']==7?'邮箱':'账号');
$jcount = M('User', 'tab_')->field('count(a.id) as count,sum(a.recharge_total) recharge_total')->table('(' . $sql . ') as a')->select();
$accessNum = $jcount[0]['count'] ?:0 ;
$perSize = 5000;//每次查询的条数
$pages = ceil($accessNum / $perSize);
for($i = 1; $i <= $pages; $i++) {
if($_REQUEST['promote_id'] && $_REQUEST['promote_id'] > -1){
$xlsData = $usermodel->table('(' . $sql1 . ') as a ')->field($field)
->join('left join tab_spend as ss on ss.user_id=a.id AND ss.pay_status = 1'.$spendprom)
->limit(($i-1)*$perSize ,$perSize)
->having($havs)
->group('a.id')
->order($order)
->select();
// echo $data;die();
}else{
$xlsData = $usermodel->table('(' . $sql1 . ') as a ')->field($field)
->join('left join tab_spend as ss on ss.user_id=a.id AND ss.pay_status = 1')
->limit(($i-1)*$perSize ,$perSize)
->having($havs)
->group('a.id')
->order($order)
->select();
}
//数据
$xlsData[$k]['small_count'] = 0;
foreach($small as $s) {
if($s['puid'] == $v['id']) {
$xlsData[$k]['small_count'] += $s['count'];break;
if($xlsData) {
$ids = array_column($xlsData,'id');
/* 在手里 */
$small = M('user','tab_')->field('count(id) as count,puid')->where(['puid'=>array('in',$ids)])->group('puid')->select();
/* 出售中 */
$small2 = M('user','tab_')->field('count(id) as count,source_puid')->where(['source_puid'=>array('in',$ids),'source_time'=>0])->group('source_puid')->select();
foreach($xlsData as $k => $v) {
$xlsData[$k]['vip_level'] = get_vip_level($v['recharge_total']);
if(empty($v['alipay'])){
$xlsData[$k]['alipay'] = '--';
}
}
foreach($small2 as $s) {
if($s['source_puid'] == $v['id']) {
$xlsData[$k]['small_count'] += $s['count'];break;
if($_REQUEST['type']==2){
$xlsData[$k]['register_type'] = get_registertype($v['register_type']);
}
$xlsData[$k]['register_time'] = date('Y-m-d H:i:s',$xlsData[$k]['register_time']);
$xlsData[$k]['login_time'] = date('Y-m-d H:i:s',$xlsData[$k]['login_time']);
$xlsData[$k]['lock_status'] = $xlsData[$k]['lock_status']==1?'正常':'锁定';
$xlsData[$k]['check_status'] = $xlsData[$k]['check_status']==1?'正常':'已拉黑';
$xlsData[$k]['device_number'] = $xlsData[$k]['device_number']."'";
$xlsData[$k]['register_type'] = $v['register_type'] == 2?'手机号':($v['register_type']==7?'邮箱':'账号');
$xlsData[$k]['small_count'] = 0;
foreach($small as $s) {
if($s['puid'] == $v['id']) {
$xlsData[$k]['small_count'] += $s['count'];break;
}
}
foreach($small2 as $s) {
if($s['source_puid'] == $v['id']) {
$xlsData[$k]['small_count'] += $s['count'];break;
}
}
unset($xlsData[$k]['age_status']);
unset($xlsData[$k]['register_way']);
}
}
foreach($xlsData as $value) {
mb_convert_variables('GBK', 'UTF-8', $value);
fputcsv($fp, $value);
$lastId = $value['id'];
}
unset($xlsData);//释放变量的内存
//刷新输出缓冲到浏览器
ob_flush();
flush();//必须同时使用 ob_flush() 和flush() 函数来刷新输出缓冲。
}
fclose($fp);
exit();
break;
case 4:

@ -123,13 +123,16 @@ class MemberController extends ThinkController
unset($_REQUEST['status']);
}
$game_map = "";
// if (isset($_REQUEST['game_name'])) {
// //$game_map .= " and tab_user_play.game_id in (" . implode(',', array_column(getGameByName($_REQUEST['game_name'], $_REQUEST['game_type']), 'id')) . ")";
// }
$spendprom = " and ss.game_id in (".implode(',', array_column(getGameByName($_REQUEST['game_name'], $_REQUEST['game_type']), 'id')).")";
$game_map .= " and tab_user_play.game_id in (" . implode(',', array_column(getGameByName($_REQUEST['game_name'], $_REQUEST['game_type']), 'id')) . ")";
$spendprom .= " and ss.game_id in (".implode(',', array_column(getGameByName($_REQUEST['game_name'], $_REQUEST['game_type']), 'id')).")";
if (isset($_REQUEST['server_name'])) {
$map['server_name'] = ['like', "{$_REQUEST['server_name']}%"];
$spendprom .= " and ss.server_name like '{$_REQUEST['server_name']}%' ";
}
$game_play_map = '';
if (isset($_REQUEST['server_name'])) {
$game_play_map .= " and tab_user_play_info.server_name = '{$_REQUEST['server_name']}' ";
}
if (isset($_REQUEST['viplevel'])) {
@ -188,6 +191,8 @@ class MemberController extends ThinkController
if($_REQUEST['promote_id'] && $_REQUEST['promote_id'] > -1){
$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,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'.$spendprom)
->join($game_map ? "tab_user_play on tab_user_play.user_id = a.id $game_map" : false)
->join($game_play_map ? "tab_user_play_info on tab_user_play_info.user_id = a.id $game_play_map" : false)
->page($page, $row)
->having($havs)
->group('a.id')
@ -197,6 +202,8 @@ class MemberController extends ThinkController
}else{
$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,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($game_map ? "tab_user_play on tab_user_play.user_id = a.id $game_map" : false)
->join($game_play_map ? "tab_user_play_info on tab_user_play_info.user_id = a.id $game_play_map" : false)
->page($page, $row)
->having($havs)
->group('a.id')
@ -208,20 +215,22 @@ class MemberController extends ThinkController
//计数
$sql = M('user', 'tab_')->field('tab_user.id,IFNULL(sum(ss.pay_amount),0) AS recharge_total')
->join('left join tab_spend as ss on ss.user_id=tab_user.id AND ss.pay_status = 1'.$spendprom)
->join($game_map ? "tab_user_play on tab_user_play.user_id = tab_user.id $game_map" : false)
->join($game_play_map ? "tab_user_play_info on tab_user_play_info.user_id = tab_user.id $game_play_map" : false)
->where($map)
->group('tab_user.id')
->where($hav)
->having($havs)->select(false);
$allcountsql = str_replace("tab_user.promote_id","ss.promote_id",$sql);
//获取总额
$allcount = M()->field('count(a.id) as count,sum(a.recharge_total) recharge_total')->table('(' . $allcountsql . ') as a')->select();
$this->assign('history_count', $allcount[0]['recharge_total']?:0);
$allcount = M()->field('count(a.id) as count,sum(a.recharge_total) recharge_total')->table('(' . $sql . ') as a')->select();
$this->assign('history_count', $allcount[0]['recharge_total']);
//替换为新表
if($_REQUEST['promote_id'] && $_REQUEST['promote_id'] > -1){
$sql = M('user', 'tab_')->field('tab_user.id,IFNULL(sum(ss.pay_amount),0) AS recharge_total')
->join('left join tab_spend as ss on ss.user_id=tab_user.id AND ss.pay_status = 1'.$spendprom)
->join($game_map ? "tab_user_play on tab_user_play.user_id = tab_user.id $game_map" : false)
->join($game_play_map ? "tab_user_play_info on tab_user_play_info.user_id = tab_user.id $game_play_map" : false)
->where($map)
->group('tab_user.id')
->where($hav)
@ -229,10 +238,10 @@ class MemberController extends ThinkController
}
$jcount = M('User', 'tab_')->field('count(a.id) as count,sum(a.recharge_total) recharge_total')->table('(' . $sql . ') as a')->select();
$count = $jcount[0]['count'] ?:0 ;
$count = $jcount[0]['count'];
//var_dump(M('User', 'tab_')->getLastSql());die();
$this->assign('user_count', $count);
// var_dump($jcount);die();
$this->assign('now_count', $jcount[0]['recharge_total']?:0);
$this->assign('now_count', $jcount[0]['recharge_total']);
$model = M('Model')->getByName('user');
@ -780,6 +789,7 @@ class MemberController extends ThinkController
}
// $map['type'] = 1;
// $map['login_time'] = ['exp', 'login_time<>0'];
$map['login_time'] = ['gt',0];
$extend = array();
$extend['map'] = $map;
@ -1241,6 +1251,8 @@ class MemberController extends ThinkController
}
if ($type == 2 && !preg_match("/(\.((2(5[0-5]|[0-4]\d))|[0-1]?\d{1,2})){3}/i", $tag)) {
return $this->error("请填写正确的ip信息如127.0.0.1");
} else if ($type == 1 && preg_match("/(\.((2(5[0-5]|[0-4]\d))|[0-1]?\d{1,2})){3}/i", $tag)) {
return $this->error("请填写正确的设备号信息");
}
$map['type'] = $type;
$map['tag'] = $tag;

@ -2889,6 +2889,11 @@ class DownloadController extends BaseController {
foreach ($records as $key1 => $value1) {
$value1['user_account'] = $this->encryption($value1['user_account']);
$value1['play_time'] = date('Y-m-d H:i:s',$value1['play_time']);
if($value1['sdk_version'] == 1) {
$value1['sdk_version'] = "Android";
}else {
$value1['sdk_version'] = "ios";
}
$xlsData[] = $value1;
}
$this->exportExcel($xlsName, $xlsCell, $xlsData,$id);

@ -1603,7 +1603,7 @@ class QueryController extends BaseController
public function userRoles()
{
$gameId = I('game_id', 0);
$relationGameId = I('relation_game_id', 0);
$serverId = I('server_id', 0);
$isSelf = I('is_self', 0);
$roleName = I('role_name', '');
@ -1633,8 +1633,13 @@ class QueryController extends BaseController
$map['_string'] = '1<>1';
}
if ($gameId != 0) {
$map['game_id'] = $gameId;
if ($relationGameId != 0) {
$gameMap['relation_game_id'] = $relationGameId;
if ($sdkVersion != 0) {
$gameMap['sdk_version'] = $sdkVersion;
}
$gameId = M('game', 'tab_')->where($gameMap)->getField('id', true);
$map['game_id'] = ['in', $gameId];
}
if ($serverId != 0) {
$map['server_id'] = $serverId;
@ -1645,9 +1650,6 @@ class QueryController extends BaseController
if ($userAccount != '') {
$map['user_account'] = ['like', '%' . $userAccount . '%'];
}
if ($sdkVersion != 0) {
$map['sdk_version'] = $sdkVersion;
}
if ($roleLevelBegin != 0 && $roleLevelEnd == 0) {
$map['role_level'] = ['egt', $roleLevelBegin];
} elseif ($roleLevelEnd != 0 && $roleLevelBegin == 0) {
@ -1693,7 +1695,7 @@ class QueryController extends BaseController
}
$games = $this->getGamesByPromote($promote);
$games = get_promote_serach_game();
$this->assign('games', $games);
$this->assign('records', $records);
@ -1704,7 +1706,7 @@ class QueryController extends BaseController
public function userRecharges()
{
$gameId = I('game_id', 0);
$relationGameId = I('relation_game_id', 0);
$serverId = I('server_id', 0);
$isSelf = I('is_self', 0);
$roleName = I('role_name', '');
@ -1748,9 +1750,14 @@ class QueryController extends BaseController
}
$subMap = [];
if ($gameId != 0) {
$map['game_id'] = $gameId;
$subMap['game_id'] = $gameId;
if ($relationGameId != 0) {
$gameMap['relation_game_id'] = $relationGameId;
if ($sdkVersion != 0) {
$gameMap['sdk_version'] = $sdkVersion;
}
$gameId = M('game', 'tab_')->where($gameMap)->getField('id', true);
$map['game_id'] = ['in', $gameId];
$subMap['game_id'] = ['in', $gameId];
}
if ($serverId != 0) {
$map['server_id'] = $serverId;
@ -1762,9 +1769,6 @@ class QueryController extends BaseController
if ($userAccount != '') {
$map['user_account'] = ['like', '%' . $userAccount . '%'];
}
if ($sdkVersion != 0) {
$map['sdk_version'] = $sdkVersion;
}
if ($isSelf) {
$map['promote_id'] = $queryPromote['id'];
}
@ -1865,7 +1869,7 @@ class QueryController extends BaseController
}
}
$games = $this->getGamesByPromote($promote);
$games = get_promote_serach_game();
$this->assign('games', $games);
$this->assign('records', $records);
@ -1894,7 +1898,16 @@ class QueryController extends BaseController
public function getGameServers()
{
$gameId = I('game_id', 0);
$servers = M('server', 'tab_')->field(['id', 'server_id', 'server_name'])->where(['game_id' => $gameId])->order('server_id asc')->select();
$sdkVersion = I('sdk_version', 0);
$servers = [];
if (!empty($gameId)) {
$map['relation_game_id'] = $gameId;
if (in_array($sdkVersion, [1, 2])) {
$map['sdk_version'] = $sdkVersion;
}
$gameIds = M('game', 'tab_')->where($map)->getField('id', true);
$servers = M('server', 'tab_')->field(['id', 'server_id', 'server_name'])->where(['game_id' => ['in', $gameIds]])->order('server_id asc')->select();
}
$this->ajaxReturn([
'status' => 1,
'msg' => '成功',
@ -1965,7 +1978,7 @@ class QueryController extends BaseController
$defaultTime = date('Y-m-d', time());
}
$sdkVersion = I('sdk_version', 0);
$gameId = I('game_id', 0);
$relationGameId = I('relation_game_id', 0);
$serverId = I('server_id', 0);
$parentId = I('parent_id', 0);
$promoteId = I('promote_id', 0);
@ -1990,7 +2003,7 @@ class QueryController extends BaseController
$searchLevel = $parent['level'] + 1;
$searchLevelName = $promoteService->getLevelName($searchLevel);
$games = $this->getGamesByPromote($parent);
$games = get_promote_serach_game();
$subPromotes = M('promote', 'tab_')->field(['id', 'account', 'real_name'])->where(['parent_id' => $parent['id']])->select();
@ -2024,15 +2037,17 @@ class QueryController extends BaseController
'isContainSubs' => true,
'basicPromotes' => $basicPromotes,
];
if ($gameId > 0) {
$params['game_id'] = $gameId;
if ($relationGameId > 0) {
$gameMap['relation_game_id'] = $relationGameId;
if ($sdkVersion > 0) {
$gameMap['sdk_version'] = $sdkVersion;
}
$gameId = M('game', 'tab_')->where($gameMap)->getField('id', true);
$params['game_id'] = ['in', $gameId];
}
if ($serverId > 0) {
$params['server_id'] = $serverId;
}
if ($sdkVersion > 0) {
$params['sdk_version'] = $sdkVersion;
}
if ($status > 0) {
$params['lock_status'] = $status;
}

@ -4,7 +4,7 @@
<link href="__CSS__/20180207/data.css" rel="stylesheet">
<link href="__CSS__/20180207/game.css" rel="stylesheet">
<link href="__CSS__/20180207/finance.css" rel="stylesheet">
<link href="__CSS__/game_detailed.css?v=1.2" rel="stylesheet">
<link href="__CSS__/game_detailed.css?v=1.3" rel="stylesheet">
<link href="__STATIC__/icons_alibaba/iconfont.css" rel="stylesheet">
<style type="text/css">
@ -245,10 +245,10 @@
<volist name="list_data" id="vo">
<li class="game-li">
<div class="media">
<div class="img-box" onclick="viewGameDetailed({$vo.id})">
<div class="img-box" onclick="viewGameDetailed({$vo.id})" style="cursor: pointer;">
<img src="__ROOT__{$vo.icon|get_cover='path'}" />
</div>
<div class="game-msg" style="width: calc(92% - 90px);">
<div class="game-msg" style="width: calc(92% - 90px);" onclick="viewGameDetailed({$vo.id})">
<h5 class="game-title">
<if condition="$type eq 10">
{$vo.relation_game_name}
@ -340,7 +340,7 @@
<div class="panel-heading"><h3 class="panel-title">游戏截图</h3></div>
<div class="pic-box">
<div class="game-slides">
<ul style="width: 1400px;" class="game-slide-li">
<ul style="width: 2800px;" class="game-slide-li">
</ul>
</div>
@ -836,6 +836,7 @@
});
$('.game-slide-li').html(html);
$('.game-slide-li').css('left', '0px');
}
$('.detail-body').show();

@ -2,7 +2,7 @@
<block name="css">
<link href="__CSS__/20180207/data.css" rel="stylesheet">
<link href="__CSS__/20180207/game.css" rel="stylesheet">
<link href="__CSS__/game_detailed.css" rel="stylesheet">
<link href="__CSS__/game_detailed.css?v=1.3" rel="stylesheet">
<link href="__CSS__/my_game.css" rel="stylesheet">
<link href="__STATIC__/icons_alibaba/iconfont.css" rel="stylesheet">
<link href="__STATIC__/jqueryselect/css/layui.css" rel="stylesheet">
@ -146,10 +146,10 @@
<volist name="list_data" id="vo">
<li class="game-li">
<div class="media">
<div class="img-box" onclick="viewGameDetailed({$vo.id})">
<div class="img-box" onclick="viewGameDetailed({$vo.id})" style="cursor: pointer;">
<img src="__ROOT__{$vo.icon|get_cover='path'}"/>
</div>
<div class="game-msg" style="width: calc(65% - 90px);">
<div class="game-msg" style="width: calc(65% - 90px);" onclick="viewGameDetailed({$vo.id})">
<h5 class="game-title">{$vo.game_name}</h5>
<p><span>{$vo.features}</span></p>
<p>

@ -14,12 +14,7 @@
</div>
<div class="trunk-content article">
<div class="trunk-search clearfix">
<table class="tab jstab">
<tr>
<td class="<eq name='Think.get.type' value='0'>current<else /><empty name='Think.get.type'>current</empty></eq> first_border" ><a href="javascript:;" style="cursor: auto;">基本信息</a></td>
<!--<td class="<eq name='Think.get.type' value='1'>current</eq>"><a href="javascript:;" >结算信息</a></td>-->
</tr>
</table>
<a href="javascript:;" style="cursor: auto;font-size: 14px;font-weight: 600;margin-left: 30px;">基本信息</a></td>
</div>
<div class="trunk-list">
<div class="tabpan <eq name='Think.get.type' value='0'>current<else /><empty name='Think.get.type'>current</empty></eq>">

@ -26,25 +26,25 @@
<form action="{:U('Query/achievement',['row'=>I('get.row')])}" method="post" enctype="multipart/form-data">
<input type="hidden" name="parent_id" value="{:I('parent_id', 0)}">
<div class="form-group normal_space">
<select id="game-select" name="game_id" class="reselect select_gallery" style="width: 220px;" >
<select id="game-select" name="relation_game_id" class="reselect select_gallery" style="width: 220px;" >
<option value="0">请选择游戏</option>
<volist name="games" id="game">
<option value="{$game.game_id}" <if condition="I('game_id') eq $game['game_id']">selected</if>>{$game.game_name}</option>
<option value="{$game.relation_game_id}" <if condition="I('relation_game_id') eq $game['relation_game_id']">selected</if>>{$game.relation_game_name}</option>
</volist>
</select>
</div>
<div class="form-group normal_space">
<select id="server-select" name="server_id" class="reselect select_gallery" style="width: 220px;" data-server="{:I('server_id', 0)}" >
<option value="0">请选择区服</option>
</select>
</div>
<div class="form-group normal_space">
<select name="sdk_version" class="reselect select_gallery" style="width: 220px;" >
<select id="sdk_version" name="sdk_version" class="reselect select_gallery" style="width: 220px;" >
<option value="0">请选择设备类型</option>
<option value="1" <if condition="I('sdk_version') === '1'">selected</if>>Andriod</option>
<option value="2" <if condition="I('sdk_version') === '2'">selected</if>>IOS</option>
</select>
</div>
<div class="form-group normal_space">
<select id="server-select" name="server_id" class="reselect select_gallery" style="width: 220px;" data-server="{:I('server_id', 0)}" >
<option value="0">请选择区服</option>
</select>
</div>
<div class="form-group normal_space">
<select name="status" class="reselect select_gallery" style="width: 220px;" >
<option value="0">帐号状态</option>
@ -165,35 +165,37 @@ $(function() {
defaultDate: defaultDate,
})
$('.select_gallery').select2()
var gameId = $('#game-select').val();
var defaultServerId = $('#server-select').attr('data-server');
getGameServers(gameId, defaultServerId)
$('#game-select').on({
change: function name() {
gameId = $('#game-select').val()
getGameServers(gameId, 0)
}
})
function getGameServers(gameId, defaultServerId) {
$.ajax({
url: "{:U('Query/getGameServers')}",
dataType: 'json',
data: {game_id: gameId},
success: function(response) {
var options = '<option value="0">请选择区服</option>'
for (var i in response.data.servers) {
var server = response.data.servers[i]
var selected = ''
if (defaultServerId > 0 && server.id==defaultServerId) {
selected = 'selected'
}
options += '<option value="' + server.server_id + '"' + selected + '>' + server.server_name + '</option>'
var gameId = $('#game-select').val();
var sdkVersion = $('#sdk_version').val();
var defaultServerId = $('#server-select').attr('data-server');
getGameServers(gameId, sdkVersion, defaultServerId)
$('#game-select,#sdk_version').on({
change: function name() {
gameId = $('#game-select').val();
sdkVersion = $('#sdk_version').val();
getGameServers(gameId, sdkVersion, 0);
}
$('#server-select').html(options)
$("#server-select").val(defaultServerId).trigger("change")
}
})
}
});
function getGameServers(gameId, sdkVersion, defaultServerId) {
$.ajax({
url: "{:U('Query/getGameServers')}",
dataType: 'json',
data: {game_id: gameId, sdk_version: sdkVersion},
success: function(response) {
var options = '<option value="0">请选择区服</option>'
for (var i in response.data.servers) {
var server = response.data.servers[i]
var selected = ''
if (defaultServerId > 0 && server.id==defaultServerId) {
selected = 'selected'
}
options += '<option value="' + server.server_id + '"' + selected + '>' + server.server_name + '</option>'
}
$('#server-select').html(options)
$("#server-select").val(defaultServerId).trigger("change")
}
})
}
})
</script>
</block>

@ -35,25 +35,25 @@
<div class="trunk-content article">
<div class="trunk-search clearfix jssearch">
<div class="form-group normal_space">
<select id="game-select" name="game_id" class="reselect select_gallery" style="width: 220px;" >
<select id="game-select" name="relation_game_id" class="reselect select_gallery" style="width: 220px;" >
<option value="0">请选择游戏</option>
<volist name="games" id="game">
<option value="{$game.game_id}" <if condition="I('game_id') === $game['game_id']">selected</if>>{$game.game_name}</option>
<option value="{$game.relation_game_id}" <if condition="I('relation_game_id') === $game['relation_game_id']">selected</if>>{$game.relation_game_name}</option>
</volist>
</select>
</div>
<div class="form-group normal_space">
<select id="server-select" name="server_id" class="reselect select_gallery" style="width: 220px;" data-server="{:I('server_id', 0)}">
<option value="0">请选择区服</option>
</select>
</div>
<div class="form-group normal_space">
<select name="sdk_version" class="reselect select_gallery" style="width: 220px;" >
<select id="sdk_version" name="sdk_version" class="reselect select_gallery" style="width: 220px;" >
<option value="0">请选择设备类型</option>
<option value="1" <if condition="I('sdk_version') === '1'">selected</if>>Andriod</option>
<option value="2" <if condition="I('sdk_version') === '2'">selected</if>>IOS</option>
</select>
</div>
<div class="form-group normal_space">
<select id="server-select" name="server_id" class="reselect select_gallery" style="width: 220px;" data-server="{:I('server_id', 0)}">
<option value="0">请选择区服</option>
</select>
</div>
<include file="Public/promote_select" />
<div class="form-group normal_space">
<input type="text" name="role_name" class="txt normal_txt" placeholder="请输入角色名" value="{:I('role_name')}">
@ -224,19 +224,21 @@ $(function(){
});
var gameId = $('#game-select').val();
var sdkVersion = $('#sdk_version').val();
var defaultServerId = $('#server-select').attr('data-server');
getGameServers(gameId, defaultServerId)
$('#game-select').on({
getGameServers(gameId, sdkVersion, defaultServerId)
$('#game-select,#sdk_version').on({
change: function name() {
gameId = $('#game-select').val()
getGameServers(gameId, 0)
gameId = $('#game-select').val();
sdkVersion = $('#sdk_version').val();
getGameServers(gameId, sdkVersion, 0);
}
})
function getGameServers(gameId, defaultServerId) {
});
function getGameServers(gameId, sdkVersion, defaultServerId) {
$.ajax({
url: "{:U('Query/getGameServers')}",
dataType: 'json',
data: {game_id: gameId},
data: {game_id: gameId, sdk_version: sdkVersion},
success: function(response) {
var options = '<option value="0">请选择区服</option>'
for (var i in response.data.servers) {

@ -24,25 +24,25 @@
<div class="trunk-content article">
<div class="trunk-search clearfix jssearch">
<div class="form-group normal_space">
<select id="game-select" name="game_id" class="reselect select_gallery" style="width: 220px;" >
<select id="game-select" name="relation_game_id" class="reselect select_gallery" style="width: 220px;" >
<option value="0">请选择游戏</option>
<volist name="games" id="game">
<option value="{$game.game_id}" <if condition="I('game_id') eq $game['game_id']">selected</if>>{$game.game_name}</option>
<option value="{$game.relation_game_id}" <if condition="I('relation_game_id') eq $game['relation_game_id']">selected</if>>{$game.relation_game_name}</option>
</volist>
</select>
</div>
<div class="form-group normal_space">
<select id="server-select" name="server_id" class="reselect select_gallery" style="width: 220px;" data-server="{:I('server_id', 0)}">
<option value="0">请选择区服</option>
</select>
</div>
<div class="form-group normal_space">
<select name="sdk_version" class="reselect select_gallery" style="width: 220px;" >
<select id="sdk_version" name="sdk_version" class="reselect select_gallery" style="width: 220px;" >
<option value="0">请选择设备类型</option>
<option value="1" <if condition="I('sdk_version') === '1'">selected</if>>Andriod</option>
<option value="2" <if condition="I('sdk_version') === '2'">selected</if>>IOS</option>
</select>
</div>
<div class="form-group normal_space">
<select id="server-select" name="server_id" class="reselect select_gallery" style="width: 220px;" data-server="{:I('server_id', 0)}">
<option value="0">请选择区服</option>
</select>
</div>
<include file="Public/promote_select" />
<div class="form-group normal_space">
<input type="text" name="role_name" class="txt normal_txt" id="uid" placeholder="请输入角色名" value="{:I('role_name')}">
@ -140,35 +140,37 @@ $(function() {
defaultDate: defaultDate,
})
$('.select_gallery').select2()
var gameId = $('#game-select').val();
var defaultServerId = $('#server-select').attr('data-server');
getGameServers(gameId, defaultServerId)
$('#game-select').on({
change: function name() {
gameId = $('#game-select').val()
getGameServers(gameId, 0)
}
})
function getGameServers(gameId, defaultServerId) {
$.ajax({
url: "{:U('Query/getGameServers')}",
dataType: 'json',
data: {game_id: gameId},
success: function(response) {
var options = '<option value="0">请选择区服</option>'
for (var i in response.data.servers) {
var server = response.data.servers[i]
var selected = ''
if (defaultServerId > 0 && server.id==defaultServerId) {
selected = 'selected'
}
options += '<option value="' + server.server_id + '"' + selected + '>' + server.server_name + '</option>'
var gameId = $('#game-select').val();
var sdkVersion = $('#sdk_version').val();
var defaultServerId = $('#server-select').attr('data-server');
getGameServers(gameId, sdkVersion, defaultServerId)
$('#game-select,#sdk_version').on({
change: function name() {
gameId = $('#game-select').val();
sdkVersion = $('#sdk_version').val();
getGameServers(gameId, sdkVersion, 0);
}
$('#server-select').html(options)
$("#server-select").val(defaultServerId).trigger("change")
}
})
}
});
function getGameServers(gameId, sdkVersion, defaultServerId) {
$.ajax({
url: "{:U('Query/getGameServers')}",
dataType: 'json',
data: {game_id: gameId, sdk_version: sdkVersion},
success: function(response) {
var options = '<option value="0">请选择区服</option>'
for (var i in response.data.servers) {
var server = response.data.servers[i]
var selected = ''
if (defaultServerId > 0 && server.id==defaultServerId) {
selected = 'selected'
}
options += '<option value="' + server.server_id + '"' + selected + '>' + server.server_name + '</option>'
}
$('#server-select').html(options)
$("#server-select").val(defaultServerId).trigger("change")
}
})
}
var promoteUrl = "{:U('Query/getSubPromotes')}"
initPromoteSelect(promoteUrl)

@ -5,7 +5,6 @@
top: 0;
left: 0;
z-index: 1500;
background-color: #F5F6FA;
}
.detail-body .detail-box {
@ -29,6 +28,8 @@
.game-detail-inner .detail-list {
padding: 20px;
margin-bottom: 20px;
background-color: #fff;
border-radius: .286rem;
}
.game-detail-inner .detail-list dl {
@ -301,6 +302,7 @@
border-bottom: 1px solid transparent;
border-top-left-radius: .214rem;
border-top-right-radius: .214rem;
border-bottom: 1px solid #e4eaec;
}
.panel-bordered > .panel-heading > .panel-title {

Loading…
Cancel
Save