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

master
ELF 5 years ago
commit f90a6a09fb

@ -1365,16 +1365,16 @@ function get_promote_levels($id = 0)
$data = M('promote', 'tab_')->field('parent_id, level')->where(array('id' => $id))->find();
switch ($data['level']) {
case '1':
return "一级推广员";
return "会长";
break;
case '2':
return "二级推广员";
return "部门长";
break;
case '3':
return "三级推广员";
return "组长";
break;
case '4':
return "四级推广员";
return "员";
break;
default:

@ -63,14 +63,28 @@ class ExportController extends Controller
$map['server_name'] = array('like','%'.trim($_REQUEST['server_name']).'%');
unset($_REQUEST['server_name']);
}
if (isset($_REQUEST['server_id'])) {
if (isset($_REQUEST['server_id'])) {
$map['server_id'] = trim($_REQUEST['server_id']);
unset($_REQUEST['server_id']);
}
if (isset($_REQUEST['game_type'])) {
$map['sdk_version'] = trim($_REQUEST['game_type']);
unset($_REQUEST['game_type']);
}
if (isset($_REQUEST['role_name'])) {
$map['role_name'] = array('like','%'.trim($_REQUEST['role_name']).'%');
unset($_REQUEST['role_name']);
}
if (isset($_REQUEST['promote_id'])) {
$queryStr = '';
if ($_REQUEST['promote_id'] == 0) {
$map['promote_id'] = '0';
} else {
$queryStr = "chain like '%/{$_REQUEST['promote_id']}/%' or id={$_REQUEST['promote_id']}";
$promoter_ids = D("Promote")->where($queryStr)->field('id')->select();
$promoter_ids ? $map['promote_id'] = ['in', implode(',', array_column($promoter_ids, 'id'))] : null;
}
}
$xlsData = M('user_play_info', 'tab_')
->where($map)
->order('id desc')
@ -171,7 +185,6 @@ class ExportController extends Controller
}
break;
case 3:
if($_REQUEST['type']==2){
$xlsCell = array(
array('id', L('Account_number_ID')),
@ -212,10 +225,34 @@ class ExportController extends Controller
}
if (isset($_REQUEST['promote_account'])) {
$map['promote_id'] = get_promote_id(trim(I('promote_account')));
unset($_REQUEST['promote_account']);
if (isset($_REQUEST['device_number'])) {
$map['tab_user.device_number'] = $_REQUEST['device_number'];
unset($_REQUEST['device_number']);
}
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{
$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'))];
}
}
}
$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 ($_GET['register_way'] == 1) {
@ -270,10 +307,12 @@ class ExportController extends Controller
$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(b.pay_amount),0) + IFNULL(sum(ss.pay_amount),0)) AS recharge_total')
->join('left join tab_deposit AS b ON tab_user.id = b.user_id AND b.pay_status = 1')
->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($map)
->group('tab_user.id')
->order($order)
->having($havs)
->having($havs)
->select();
if($xlsData) {
$ids = array_column($xlsData,'id');
@ -640,7 +679,7 @@ class ExportController extends Controller
}
$map1 = $map;
$map1['pay_status'] = 1;
$total = D('Spend')->where($map1)->sum('pay_amount');
$total = D('Spend')->where($map1)->join($tab_promote_join)->sum('pay_amount');
if (isset($map['pay_status']) && $map['pay_status'] == 0) {
$total = sprintf("%.2f", 0);
} else {
@ -3101,7 +3140,19 @@ if ($key == 'model'){
}
if (isset($_REQUEST['game_id'])) {
$map['game_id'] = $_REQUEST['game_id'];
}
}
if (isset($_REQUEST['game_name'])) {
$map['game_name'] = ['like', $_REQUEST['game_name']."%"];
unset($_REQUEST['game_name']);
}
if (isset($_REQUEST['game_type'])) {
$map['sdk_version'] = $_REQUEST['game_type'];
unset($_REQUEST['game_type']);
}
if (isset($_REQUEST['server_name'])) {
$map['server_name'] = $_REQUEST['server_name'];
unset($_REQUEST['server_name']);
}
if (isset($_REQUEST['timestart']) && isset($_REQUEST['timeend'])) {
$map['login_time'] = array('BETWEEN', array(strtotime($_REQUEST['timestart']), strtotime($_REQUEST['timeend']) + 24 * 60 * 60 - 1));
}elseif(isset($_REQUEST['timestart'])){
@ -3111,7 +3162,9 @@ if ($key == 'model'){
}
if (isset($_REQUEST['account'])) {
$map['user_account'] = array('like', '%' . trim($_REQUEST['account']) . '%');
}
}
$map['login_time'] = array('neq', 0);
$page = intval($_REQUEST['p']);
@ -3120,7 +3173,7 @@ if ($key == 'model'){
$row = $_REQUEST['row']?$_REQUEST['row']:10;
$data = M('UserLoginRecord','tab_')
->where($map)->order('id desc')->select();
->where($map)->order('id desc')->select();
$xlsData = [];
@ -4203,11 +4256,16 @@ if ($key == 'model'){
if($_REQUEST['game_name']=='全部'){
unset($_REQUEST['game_name']);
}else{
$extend['game_name']=['like', "{$_REQUEST['game_name']}%"];
$map['server_version']=$_REQUEST['server_version'];
$map['game_name']=['like', "{$_REQUEST['game_name']}%"];
unset($_REQUEST['game_name']);
}
}
if(isset($_REQUEST['server_name'])){
$map['server_name']=$_REQUEST['server_name'];
unset($_REQUEST['server_name']);
}
$model = M('Server','tab_');
if($_REQUEST['type']==2) {

@ -39,6 +39,10 @@ class ServerController extends ThinkController {
unset($_REQUEST['game_name']);
}
}
if(isset($_REQUEST['server_name'])){
$extend['server_name']=$_REQUEST['server_name'];
unset($_REQUEST['server_name']);
}
if(empty($_GET['type']) || $_GET['type'] == 1) {
$extend['developers'] = array('EQ',0);
}else{

@ -580,6 +580,10 @@ function think_ucenter_md5($str, $key = 'ThinkUCenter'){
}
}
if (isset($_REQUEST['game_type'])) {
$map['sdk_version'] = trim($_REQUEST['game_type']);
unset($_REQUEST['game_type']);
}
empty(I('user_account')) || $map['user_account'] = ['like',"%".I('user_account')."%"];
$list = $this->lists(M('user_play_info', 'tab_'), $map, 'play_time desc');
$this->assign('list', $list);

@ -85,6 +85,11 @@
</volist> -->
</select>
</div>
<div class="input-list input-list-server search_label_rehab">
<select id="server_name" name="server_name" class="select_gallery" style="width:120px;">
<option value="">区服名称</option>
</select>
</div>
<div class="input-list" >
<input type="text" id="time-start" name="timestart" class="" value="{:I('timestart')}" placeholder="开服开始时间" />
-
@ -326,7 +331,24 @@ $(function(){
});
$("#server_version").change();
var game_server = "{:I('server_name')}";
$("#game_name").change(function(){
$.ajax({
url:"{:U('Ajax/getGmeServer')}",
type:"post",
data:{sdk_version:$("#server_version option:selected").val(), game_name:$("#game_name option:selected").val()},
dataType:'json',
success:function(data){
str = "<option value=''>请选择区服</option>";
for (var i in data){
str += "<option value='"+data[i].server_name+"' "+(game_server && data[i].server_name == game_server?'selected':'')+">"+data[i].server_name+"</option>"
}
$("#server_name").empty();
$("#server_name").append(str);
$("#server_name").select2();
}
})
});
})
</script>
</block>

@ -154,6 +154,9 @@
'game_name'=>I('game_name'),
'server_id'=>I('server_id'),
'role_name'=>I('role_name'),
'promote_level'=>I('promote_level'),
'promote_id'=>I('promote_id'),
'game_type'=>I('game_type'),
'xlsname'=>'玩家_角色查询',
))}">导出</a>
{$_page}

@ -716,16 +716,16 @@ function get_promote_levels($id = 0)
$data = M('promote', 'tab_')->field('parent_id, level')->where(array('id' => $id))->find();
switch ($data['level']) {
case '1':
return "一级推广员";
return "会长";
break;
case '2':
return "二级推广员";
return "部门长";
break;
case '3':
return "三级推广员";
return "组长";
break;
case '4':
return "四级推广员";
return "员";
break;
default:

@ -120,10 +120,10 @@ class PromoteController extends BaseController
//计算当日用户充值数据
// $map['_string'] = "promote_id = {$promote_id} or tab_promote.parent_id = {$promote_id} or tab_promote.grand_id = {$promote_id} ";
//计算当日用户充值数据
$map['_string'] = "promote_id = {$promote_id} or tab_promote.parent_id = {$promote_id} or tab_promote.chain like '%/{$promote_id}/%' ";
// $map['_string'] = "promote_id = {$promote_id} or tab_promote.parent_id = {$promote_id} or tab_promote.chain like '%/{$promote_id}/%' ";
$pay_time = " between 0 and " . time();
$spendData = $this->caculateSpend($pay_time, $map['_string']);
$spendData = $this->caculateSpend($pay_time, []);
$promoteId = implode(',', $promoteId);
if ($promoteId) {
@ -136,21 +136,39 @@ class PromoteController extends BaseController
$yesterdays = total(5);
$week = total(2);
$mounth = total(3);
$map['tp1.id'] = $promote_id;
//计算今日的统计数据
$data = M('User', 'tab_')
->field('promote_account,promote_id,date_format(FROM_UNIXTIME(register_time),"%Y-%m-%d") AS time, count(tab_user.id) as count,
IF(tab_promote.grand_id>0,tab_promote.grand_id,IF(tab_promote.grand_id=0 and tab_promote.parent_id >0,tab_promote.parent_id,promote_id)) as promote_id1 ,
count(IF(register_time ' . $yesterdays . ',1,null)) as yesterday,
count(IF(register_time ' . $today . ',1,null)) as today,
count(IF(register_time ' . $week . ',1,null)) as week,
count(IF(register_time ' . $mounth . ',1,null)) as mounth')
->join('tab_promote on promote_id = tab_promote.id', 'left')
$data = M('promote', 'tab_')->alias('tp1')->field('tp1.account as promote_account,tp1.id, date_format(FROM_UNIXTIME(register_time),"%Y-%m-%d") AS time, count(u.id) as count,
count(IF(register_time ' . $yesterdays . ',1,null)) as yesterday,
count(IF(register_time ' . $today . ',1,null)) as today,
count(IF(register_time ' . $week . ',1,null)) as week,
count(IF(register_time ' . $mounth . ',1,null)) as mounth')
->join("tab_promote AS tp2 ON tp2.`chain` LIKE CONCAT('%/', tp1.id, '/%')", 'left')
->join("tab_user as u on tp2.id = u.promote_id", 'left')
->join(false)
->where($map)
->group('promote_id1')
->having('promote_id != 0')
->order('count desc,register_time')
->group('tp1.id')
->order('count desc, register_time')
->find();
// echo M('User','tab_')->_sql();die();
// $data = M('User', 'tab_')
// ->field('promote_account,promote_id,date_format(FROM_UNIXTIME(register_time),"%Y-%m-%d") AS time, count(tab_user.id) as count,
// IF(tab_promote.grand_id>0,tab_promote.grand_id,IF(tab_promote.grand_id=0 and tab_promote.parent_id >0,tab_promote.parent_id,promote_id)) as promote_id1 ,
// count(IF(register_time ' . $yesterdays . ',1,null)) as yesterday,
// count(IF(register_time ' . $today . ',1,null)) as today,
// count(IF(register_time ' . $week . ',1,null)) as week,
// count(IF(register_time ' . $mounth . ',1,null)) as mounth')
// ->join('tab_promote on promote_id = tab_promote.id', 'left')
// ->where($map)
// ->group('promote_id1')
// ->having('promote_id != 0')
// ->order('count desc,register_time')
// ->find();
// var_dump($data);die();
// echo M('promote', 'tab_')->_sql();die();
$total_money = $this->pay_total(0, 0, $promoteId);
$today_add_user_money = $this->pay_total(1, 1, $promoteId);
@ -161,11 +179,12 @@ class PromoteController extends BaseController
//计算昨天用户的统计数据,当日用户充值数据
$pay_time = " between {$yesterday_start} and {$yesterday_end}";
$createTime = ['between', array($yesterday_start, $yesterday_end - 1)];
$yesterdaySpendData = $this->caculateSpend($pay_time, $map['_string'], $createTime);
$yesterdaySpendData = $this->caculateSpend($pay_time, [], $createTime);
$todayAddSpendData = $this->caculateSpend($pay_time, $map['_string'], [], 1);
$todayAddSpendData = $this->caculateSpend($pay_time, [], [], 1);
// var_dump($todayAddSpendData);die();
$mounthAddSpendData = $this->caculateSpend($pay_time, $map['_string'], [], 2);
$mounthAddSpendData = $this->caculateSpend($pay_time, [], [], 2);
$yesterday_user_regist_count = M("user", "tab_")->where(
array("promote_id" => array('in', $promoteId),
@ -289,10 +308,14 @@ class PromoteController extends BaseController
->group('promote_id')
->select(false);
$spendData = $spend->field('a.promote_account,a.promote_id,a.time,sum(a.scount) as count,sum(a.today) as today,sum(a.week) as week,sum(a.mounth) as mounth,IF(tab_promote.grand_id>0,tab_promote.grand_id,IF(tab_promote.grand_id=0 and tab_promote.parent_id >0,tab_promote.parent_id,promote_id)) as promote_id1')
->join('tab_promote on promote_id = tab_promote.id', 'left')
->where($condition)
->table('(' . $spendData . ') as a')->group('promote_id1')->order('count desc,a.ordertime')->find();
// $promote_map = "tp1.`chain` = '/'";
$promote_id = get_pid();
$promote_map = "tp1.`id` = {$promote_id}";
$spendData = $spend->field('t.pid as promote_id,t.promote_account,sum(a.scount) AS count,sum(a.today) AS today,sum(a. WEEK) AS WEEK,sum(a.mounth) AS mounth')
->join("INNER JOIN (SELECT tp2.*, tp1.id AS pid, tp1.account as promote_account FROM tab_promote tp1 LEFT JOIN tab_promote tp2 ON tp2.`chain` LIKE CONCAT('%/', tp1.id, '/%') where $promote_map ) AS t ON promote_id = t.id")
->where($condition)->table('(' . $spendData . ') as a')->group('t.pid')->order('count desc,a.ordertime')->find();
// var_dump($spendData);die();
$spendData['rand'] = 1;
$spendData['count'] = $spendData['count'] / 100;
$spendData['today'] = $spendData['today'] / 100;

Loading…
Cancel
Save