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

master
zhanglingsheng 5 years ago
commit 6b675aa345

@ -67,6 +67,7 @@ class DepositController extends ThinkController {
unset($_REQUEST['pay_way']);
}
if(isset($_REQUEST['pay_status'])){
$map['pay_status']=$_REQUEST['pay_status'];
unset($_REQUEST['pay_status']);

@ -367,7 +367,11 @@ class ExportController extends Controller
$game_map = "";
$game_map .= " and tab_user_play.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')) . ")";
if (!empty($_REQUEST['game_name']) || !empty($_REQUEST['game_type'])) {
$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'])) {

@ -25,8 +25,12 @@ class GameTypeController extends ThinkController {
if(isset($request['status_show'])){
if($request['status_show']!='all'){
$extend['status_show'] = $request['status_show'];
} else {
unset($extend['status_show']);
}
unset($request['status_show']);
} else {
unset($extend['status_show']);
}
$this->m_title = '游戏类型';
@ -40,6 +44,8 @@ class GameTypeController extends ThinkController {
if(isset($request['status_show'])){
if($request['status_show']!='all'){
$extend['status'] = $request['status_show'];
} else {
unset($extend['status']);
}
unset($request['status_show']);
}

@ -88,7 +88,7 @@ class GiftbagController extends ThinkController {
$map['sdk_version'] = $_REQUEST['sdk_version'];
$game_ids = M('game','tab_')->field('id')->where($map)->select();
$game_ids = array_column($game_ids,'id');
$extend['sdk_version'] = ['in',$game_ids];
$extend['game_id'] = ['in',$game_ids];
unset($_REQUEST['sdk_version']);
}
}

@ -124,8 +124,10 @@ class MemberController extends ThinkController
}
$game_map = "";
$game_map .= " and tab_user_play.game_id in (" . implode(',', array_column(getGameByName($_REQUEST['game_name'], $_REQUEST['game_type']), 'id')) . ")";
if (!empty($_REQUEST['game_name']) || !empty($_REQUEST['game_type'])) {
$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'])) {
$spendprom .= " and ss.server_name like '{$_REQUEST['server_name']}%' ";

@ -22,6 +22,7 @@ class PromoteCoinController extends ThinkController
$extend['source_id'] = 0;
$map = $extend;
} else {
$extend['type'] = 1;
$extend['promote_id'] = $_GET['promote_id'];
$extend['promote_type'] = $_GET['promote_type'];

@ -63,6 +63,9 @@ unset($_REQUEST['parent_id']);
$map['ba_id']=$_REQUEST['admin_id'];
}
}
if (I('status') || I('status', -1) == 0) {
$map['status'] = I('status');
}
if (I("promote_level")) {
$map['level'] = I("promote_level");
}

@ -105,7 +105,7 @@ class RechargeSumController extends ThinkController
}
$count = count($data);
$export_data = $data;
$page = set_pagination($count, $row);
if ($page) {
$this->assign('_page', $page);
@ -122,7 +122,7 @@ class RechargeSumController extends ThinkController
//判断是否执行导出
if (I('export') == 1) {
$this->exportSum($data);
$this->exportSum($export_data);
}
$this->assign('meta_title', "充值汇总");
$this->assign('list_data', $data);

@ -48,15 +48,16 @@
placeholder="订单号"/>
</div>
<div class="input-list">
<input type="text" id="time-start" name="time-start" class="" value="{:I('time-start')}"
<input type="text" id="time-start" name="time-start" class="" value="{:I('time-start')|I('start')}"
placeholder="充值开始时间"/>
-
<div class="input-append date" id="datetimepicker" style="display:inline-block">
<input type="text" id="time-end" name="time-end" class="" value="{:I('time-end')}"
<input type="text" id="time-end" name="time-end" class="" value="{:I('time-end')|I('end')}"
placeholder="充值结束时间"/>
<span class="add-on"><i class="icon-th"></i></span>
</div>
</div>
<div class="input-list">
<input type="text" id="search-input" name="pay_ip" class="" value="{:I('pay_ip')}"
placeholder="充值IP"/>

@ -39,7 +39,7 @@
<!--显示状态搜索-->
<div class="input-list">
<select name="status_show">
<option value="all">显示状态</option>
<option value="">显示状态</option>
<option value="1">已开启</option>
<option value="0">已关闭</option>
</select>

@ -1289,25 +1289,12 @@ class DownloadController extends BaseController {
$levelPromote = $this->getLevelPromote();
$queryPromote = $this->getQueryPromote($levelPromote);
$map2[] = [
'_logic' => 'or',
'id' => $queryPromote['id'],
'chain' => ['like', $queryPromote['chain'] . $queryPromote['id'] . '/%']
];
$map2['chain'] = ['like', $queryPromote['chain'] . $queryPromote['id'] . '/%'];
$ids = M('promote', 'tab_')->where($map2)->getField('id', true);
if(empty($ids)) {
$ids = array();
}
if(empty($levelPromote)) {
array_push($ids,PID);
}
// array_push($ids,$queryPromote['id']);
if (!empty($ids)) {
$map['promote_id'] = ['in',$ids];
}else {
$map['_string'] = '1<>1';
}
$ids[] = $queryPromote['id'];
$map = ['promote_id' => ['in', $ids]];
$subMap = ['promote_id' => ['in', $ids]];
if ($gameId != 0) {
$gameMap['relation_game_id'] = $gameId;
@ -1315,7 +1302,9 @@ class DownloadController extends BaseController {
$gameMap['sdk_version'] = $sdkVersion;
}
$gameId1 = M('game', 'tab_')->where($gameMap)->getField('id', true);
$map['game_id'] = ['in', $gameId1];
$subMap['game_id'] = ['in', $gameId1];
}
if ($serverId != 0) {
$map['server_id'] = $serverId;
@ -2816,21 +2805,33 @@ class DownloadController extends BaseController {
$subMap = [];
if(!empty($map['game_id'])) {
$subMap['game_id'] = $map['game_id'];
$map['uc.game_id'] = $map['game_id'];
unset($map['game_id']);
}
if(!empty($map['server_id'])) {
$subMap['server_id'] = $map['server_id'];
$map['ui.server_id'] = $map['server_id'];
unset($map['server_id']);
}
if(!empty($map['role_name'])) {
$map['ui.role_name'] = $map['role_name'];
unset($map['role_name']);
}
if(!empty($map['user_account'])) {
$map['ui.user_account'] = $map['user_account'];
unset($map['user_account']);
}
if(!empty($map['promote_id'])) {
$map['uc.promote_id'] = $map['promote_id'];
unset($map['promote_id']);
}
$costBegin = $map['costbegin'];
$costEnd = $map['costend'];
unset($map['costbegin']);
unset($map['costend']);
$nowTime = strtotime(date('Y-m-d 00:00:00', time()));
$subMap['create_time'] = ['between', [$map['begintime'], $map['endtime'] - 1]];
$roleIdMap = $subMap;
$roleIds = M('user_play_data_count', 'tab_')->where($roleIdMap)->group('role_id')->getField('role_id', true);
if (count($roleIds) > 0) {
$map['role_id'] = ['in', $roleIds];
}
if ($costBegin != '' || $costEnd != '') {
$having = '';
if ($costBegin != '' && $costEnd != '') {
@ -2845,40 +2846,24 @@ class DownloadController extends BaseController {
->group('game_id,server_id,role_id')
->having($having)
->buildSql();
$map['_string'] = 'role_id in (' . $subQuery . ')';
}
$spendMap['uc.create_time'] = ['between', [$map['begintime'], $map['endtime'] - 1]];
$spendMap['_string'] = 'uc.game_id = tab_user_play_info.game_id and uc.server_id = tab_user_play_info.server_id and uc.role_id = tab_user_play_info.role_id';
// $map['create_time'] = ['between', [strtotime(date('Y-m-d 00:00:00')) - 6*24*3600, strtotime(date('Y-m-d 23:59:59'))]];
$sqlCost = M('user_play_data_count', 'tab_')->alias('uc')
->field('sum(uc.recharge_cost) cost')
->where($spendMap)
->buildSql();
$sqlCount = M('user_play_data_count', 'tab_')->alias('uc')
->field('sum(uc.recharge_count) count')
->where($spendMap)
->buildSql();
$spendMap['uc.create_time'] = ['between', [strtotime(date('Y-m-d 00:00:00')), strtotime(date('Y-m-d 23:59:59'))]];
$sqlTodayCost = M('user_play_data_count', 'tab_')->alias('uc')
->field('sum(uc.recharge_count) count')
->where($spendMap)
->buildSql();
$map['_string'] = 'ui.role_id in (' . $subQuery . ')';
}
$map['uc.create_time'] = ['between', [$map['begintime'], $map['endtime'] - 1]];
unset($map['begintime']);
unset($map['endtime']);
$subQuery = M('user_play_info', 'tab_')
->field("*,$sqlCost as recharge_cost,$sqlCount as recharge_count,$sqlTodayCost as recharge_cost_today")
->where($map)
->having('recharge_cost > 0')
->order('play_time desc')
->buildSql();
$roles = M()->field(' * ')
->table($subQuery)
->alias('a')
->order('play_time desc')
->select();
//$spendMap['_string'] = 'uc.game_id = tab_user_play_info.game_id and uc.server_id = tab_user_play_info.server_id and uc.role_id = tab_user_play_info.role_id';
$fieldUC = "sum(uc.recharge_cost) recharge_cost,sum(uc.recharge_count) recharge_count,sum(if(uc.create_time = {$nowTime},uc.recharge_cost,0)) as recharge_cost_today";
$fieldUI = "ui.user_account,ui.game_name,ui.role_name,ui.role_level,ui.server_name,ui.play_time,ui.play_ip,ui.promote_account,ui.sdk_version";
$field = $fieldUC . ',' . $fieldUI;
$subQuery = M('user_play_data_count', 'tab_')->alias('uc')
->field($field)
->join('tab_user_play_info as ui on ui.game_id = uc.game_id and ui.server_id = uc.server_id and ui.role_id = uc.role_id')
->where($map)
->group('uc.role_id,uc.server_id,uc.game_id')
->buildSql();
$roles = M()->alias('record')
->table($subQuery)
->select();
foreach ($roles as $role) {
$records[] = [
'user_account' => encryption($role['user_account']),

@ -1785,7 +1785,7 @@ class QueryController extends BaseController
$map['_string'] = 'ui.role_id in(' . $subQuery . ')';
}
$orderBy = 'ui.play_time desc';
$orderBy = 'play_time desc';
if (!empty($sortName)) {
if (in_array($sortName, $sortNameData)) {
$desc = ' desc';
@ -1814,7 +1814,7 @@ class QueryController extends BaseController
$field = $fieldUC . ',' . $fieldUI;
$subQuery = M('user_play_data_count', 'tab_')->alias('uc')
->field($field)
->join('tab_user_play_info as ui on ui.promote_id = uc.promote_id and ui.game_id = uc.game_id and ui.server_id = uc.server_id and ui.role_id = uc.role_id')
->join('tab_user_play_info as ui on ui.game_id = uc.game_id and ui.server_id = uc.server_id and ui.role_id = uc.role_id')
->where($map)
->group('uc.role_id,uc.server_id,uc.game_id')
->buildSql();

@ -559,3 +559,7 @@ ADD COLUMN `promote_id` int(11) NOT NULL DEFAULT 0 COMMENT '推广员ID';
ALTER TABLE `tab_user_play_data_count`
DROP INDEX `search`,
ADD INDEX `search`(`user_id`, `promote_id`, `game_id`, `server_id`, `role_id`, `create_time`) USING BTREE;
----
ALTER TABLE `tab_user_play_info`
ADD INDEX `game_id`(`game_id`, `server_id`, `role_id`);
Loading…
Cancel
Save