公会统计5

master
chenzhi 5 years ago
parent c05698e991
commit 1450d05677

@ -345,7 +345,11 @@ class FinancePromoteController extends AdminController
$map['s.pay_time'] = ['LT', strtotime($_REQUEST['time_end']) + 86399]; $map['s.pay_time'] = ['LT', strtotime($_REQUEST['time_end']) + 86399];
} }
//判断是否有推广员 //判断是否有推广员
$level = 1;
if ($_REQUEST['promote_id'] != '') { if ($_REQUEST['promote_id'] != '') {
if ($_REQUEST['promote_id'] != 0){
$level = M('promote', 'tab_')->field('level')->where(array('id' => $_REQUEST['promote_id']))->find()['level'];
}
if ($_REQUEST['promote_id'] == 0 || $_REQUEST['promote_type'] == 2) { if ($_REQUEST['promote_id'] == 0 || $_REQUEST['promote_type'] == 2) {
$map['s.promote_id'] = $_REQUEST['promote_id']; $map['s.promote_id'] = $_REQUEST['promote_id'];
} else { } else {
@ -355,6 +359,7 @@ class FinancePromoteController extends AdminController
} }
} }
} }
$this->assign('promote_level', $level);
//游戏统计列表 //游戏统计列表
$data =self::gameStatisticsData($map, $row, $p); $data =self::gameStatisticsData($map, $row, $p);
@ -388,6 +393,18 @@ class FinancePromoteController extends AdminController
//游戏订单详情 //游戏订单详情
public function gameStatisticsDetail($p = 1) { public function gameStatisticsDetail($p = 1) {
set_time_limit(0); set_time_limit(0);
if(isset($_REQUEST['game_id'])){
//转化为名称和类型,重新请求
$game = M("game","tab_")->field("relation_game_name,sdk_version")->where(" id = {$_REQUEST['game_id']} ")->find();
if($game === false){
$this->error("参数错误");
}
$_GET['game_name'] = $game['relation_game_name'];
$_GET['game_type'] = $game['sdk_version'];
unset($_GET['game_id']);
$this->redirect(ACTION_NAME, I('get.'));
}
if (isset($_REQUEST['pay_way'])) { if (isset($_REQUEST['pay_way'])) {
$map['pay_way'] = $_REQUEST['pay_way']; $map['pay_way'] = $_REQUEST['pay_way'];
@ -397,12 +414,15 @@ class FinancePromoteController extends AdminController
$map['pay_order_number'] = $_REQUEST['pay_order_number']; $map['pay_order_number'] = $_REQUEST['pay_order_number'];
} }
if (!empty(I('partner_id'))&&empty(I("game_id"))) { if (!empty(I('partner_id'))) {
$wherePartner = I('partner_id'); $wherePartner = I('partner_id');
$gameId = M("game","tab_")->field("id")->where("partner_id={$wherePartner}")->select(); $gameId = M("game","tab_")->field("id")->where("partner_id={$wherePartner}")->select();
$gameId = implode(',',array_column($gameId,'id')); $gameId = implode(',',array_column($gameId,'id'));
$map['game_id'] = ['in',$gameId]; $map['game_id'] = ['in',$gameId];
} }
if (isset($_REQUEST['game_name']) || isset($_REQUEST['game_type'])) {
$map["game_id"] = array("in",implode(',', array_column(getGameByName($_REQUEST['game_name'], $_REQUEST['game_type']), 'id')) );
}
if (isset($_REQUEST['time_start']) && isset($_REQUEST['time_end'])) { if (isset($_REQUEST['time_start']) && isset($_REQUEST['time_end'])) {
$map['pay_time'] = ['between', [strtotime($_REQUEST['time_start']), strtotime($_REQUEST['time_end']) + 86399]]; $map['pay_time'] = ['between', [strtotime($_REQUEST['time_start']), strtotime($_REQUEST['time_end']) + 86399]];
@ -423,9 +443,6 @@ class FinancePromoteController extends AdminController
} }
} }
} }
// if (!empty(I("promote_id"))) {
// $promote_id[] = I("promote_id");
// }
if (!empty(I("root_id"))) { if (!empty(I("root_id"))) {
$root_id = I("root_id"); $root_id = I("root_id");
@ -459,7 +476,6 @@ class FinancePromoteController extends AdminController
if (!empty(I('user_nickname'))) { if (!empty(I('user_nickname'))) {
$map['game_player_name'] = array('like',I("user_nickname").'%'); $map['game_player_name'] = array('like',I("user_nickname").'%');
} }
// var_dump($map);die();
$field = "pay_order_number,FROM_UNIXTIME(pay_time) as pay_time,user_account,user_nickname,game_name,promote_account,spend_ip,server_name,game_player_name,pay_amount,cost,pay_way"; $field = "pay_order_number,FROM_UNIXTIME(pay_time) as pay_time,user_account,user_nickname,game_name,promote_account,spend_ip,server_name,game_player_name,pay_amount,cost,pay_way";
$group = ""; $group = "";
$order = "pay_time DESC"; $order = "pay_time DESC";
@ -468,7 +484,7 @@ class FinancePromoteController extends AdminController
$data[$key]['pay_way'] = getPayType($value['pay_way']); $data[$key]['pay_way'] = getPayType($value['pay_way']);
} }
$totalData = D('spend')->totalGameStatistics($map, false); $totalData = self::totalGameStatisticsData($map, false);
$sumCash = $totalData['cash_count'] ?? 0; $sumCash = $totalData['cash_count'] ?? 0;
$sumBalance = $totalData['balance_coin_count'] ?? 0; $sumBalance = $totalData['balance_coin_count'] ?? 0;
$sumInside = $totalData['inside_cash_count'] ?? 0; $sumInside = $totalData['inside_cash_count'] ?? 0;
@ -507,6 +523,7 @@ class FinancePromoteController extends AdminController
$query = $query->page($page,$row); $query = $query->page($page,$row);
} }
$data = $query->select(); $data = $query->select();
// dump($data);die();
return $data; return $data;
} }
private function totalGameStatisticsData($map, $join = true) private function totalGameStatisticsData($map, $join = true)
@ -519,7 +536,7 @@ class FinancePromoteController extends AdminController
$query = $query->join('LEFT JOIN tab_game as g ON s.game_id=g.id') $query = $query->join('LEFT JOIN tab_game as g ON s.game_id=g.id')
->join('LEFT JOIN tab_partner as p ON g.partner_id=p.id'); ->join('LEFT JOIN tab_partner as p ON g.partner_id=p.id');
} }
$data = $query->where(['s.pay_status' => 1, 'pay_game_status' => 1]) $data = $query->where(['s.pay_status' => 1])
->where($map) ->where($map)
->find(); ->find();
return $data; return $data;

@ -82,7 +82,7 @@
<if condition="$_GET['promote_type'] eq 1"> <if condition="$_GET['promote_type'] eq 1">
统计推广员及其下属推广员的游戏相关统计 统计推广员及其下属推广员的游戏相关统计
<else/> <else/>
仅统计推广员自己 不含其下属推广员的游戏相关统计 仅统计推广员自己 <span style="color: red;">不含其下属推广员</span>的游戏相关统计
</if> </if>
<else/> <else/>
游戏相关统计 游戏相关统计
@ -106,9 +106,6 @@
<div class="input-list input-list-game search_label_rehab"> <div class="input-list input-list-game search_label_rehab">
<select id="game_name" name="game_name" class="select_gallery" > <select id="game_name" name="game_name" class="select_gallery" >
<option value="">游戏名称</option> <option value="">游戏名称</option>
<!-- <volist name=":get_game_list(null, $_GET['game_type'])" id="vo">
<option game-id="{$vo.id}" value="{$vo.id}">{$vo.game_name}</option>
</volist> -->
</select> </select>
</div> </div>
<div class="input-list input-list-game search_label_rehab"> <div class="input-list input-list-game search_label_rehab">
@ -214,7 +211,7 @@
false))}"><if condition="$data.inside_cash_count neq ''">{$data.inside_cash_count}<else/>0</if></td> false))}"><if condition="$data.inside_cash_count neq ''">{$data.inside_cash_count}<else/>0</if></td>
<td ><if condition="$data.all_cash_count neq ''">{$data.all_cash_count}<else/>0</if></td> <td ><if condition="$data.all_cash_count neq ''">{$data.all_cash_count}<else/>0</if></td>
<td > <td >
<a href="{:U('FinancePromote/gameStatisticsDetail',array_merge(I('get.'),['game_name'=>$data['game_name']]))}" >订单查看</a> <a href="{:U('FinancePromote/gameStatisticsDetail',array_merge(I('get.'),['game_id'=>$data['game_id'],'game_name'=>$data['game_name'],'promote_level'=>$promote_level]))}" >订单查看</a>
</td> </td>
</tr> </tr>
</volist> </volist>
@ -225,7 +222,7 @@
<td><if condition="$sumInside neq ''">{$sumInside}<else/>0</if></td> <td><if condition="$sumInside neq ''">{$sumInside}<else/>0</if></td>
<td><if condition="$sumAll neq ''">{$sumAll}<else/>0</if></td> <td><if condition="$sumAll neq ''">{$sumAll}<else/>0</if></td>
<td> <td>
<a href="{:U('FinancePromote/gameStatisticsDetail',I('get.'))}" >订单查看</a> <a href="{:U('FinancePromote/gameStatisticsDetail',array_merge(I('get.'),['promote_level'=>1]))}" >订单查看</a>
</td> </td>
</tr> </tr>
</notemtpy> </notemtpy>
@ -279,16 +276,14 @@
var href = $(this).attr('href'); var href = $(this).attr('href');
$(this).removeAttr('href'); $(this).removeAttr('href');
window.location.replace(href) window.location.replace(href)
console.log(href)
}); });
//导航高亮 //导航高亮
highlight_subnav('{:U('Finance/gameStatistics')}'); highlight_subnav('{:U("FinancePromote/index")}');
$(function(){ $(function(){
//搜索功能 //搜索功能
$("#search").click(function(){ $("#search").click(function(){
console.log(111);
var starttime = $.trim($('#time-start').val()); var starttime = $.trim($('#time-start').val());
var endtime = $.trim($('#time-end').val()); var endtime = $.trim($('#time-end').val());
@ -349,7 +344,7 @@
} }
}) })
} }
$("#partner_id, #sdk_type").change(function(){ $("#partner_id, #game_type").change(function(){
get_game_list(); get_game_list();
}); });
$('#time_start').datetimepicker({ $('#time_start').datetimepicker({
@ -366,40 +361,6 @@
autoclose: true, autoclose: true,
pickerPosition: 'bottom-left' pickerPosition: 'bottom-left'
}) })
// $('#time-start').datetimepicker({
// format: 'yyyy-mm-dd',
// language: "zh-CN",
// showMeridian:true,
// pickDate:true,
// minView: 2,
// autoclose: true,
// pickTime:true,
// todayBtn:true,
// }).on('change',function(ev){
// var val = new Date($.trim($(this).val())).getTime();
// var end = new Date($.trim($('#time-end').val())).getTime();
// if (val>end) {
// layer.msg('开始时间大于结束时间!');$(this).val('');
// }
// return false;
// });
// $("#time-end").datetimepicker({
// format:"yyyy-mm-dd",
// language: "zh-CN",
// showMeridian:true,
// minView:2,
// autoclose:true,
// todayBtn:true,
// }).on('change',function(ev){
// var val = new Date($.trim($(this).val())).getTime();
// var start = new Date($.trim($('#time-start').val())).getTime();
// if (val<start) {
// layer.msg('开始时间大于结束时间!');$(this).val('');
// }
// return false;
// });
$("#partner_id").change(); $("#partner_id").change();
function get_partnet_list() function get_partnet_list()
@ -423,7 +384,7 @@
} }
}) })
} }
$("#game_name, #sdk_type").change(function(){ $("#game_name, #game_type").change(function(){
get_partnet_list(); get_partnet_list();
}); });

@ -30,8 +30,22 @@
<div class="cf main-place top_nav_list navtab_list"> <div class="cf main-place top_nav_list navtab_list">
<h3 class="page_title">{$_REQUEST['game_name']}游戏订单查看</h3> <h3 class="page_title">
<p class="description_text"></p> <if condition="isset($_GET['promote_id'])">
[{:get_promote_name(I('promote_id'))}]
</if>
{$_REQUEST['game_name']}游戏订单查看</h3>
<p class="description_text">
<if condition="isset($_GET['promote_id'])">
<if condition="$_GET['promote_type'] eq 1">
统计推广员及其下属推广员的游戏订单相关统计
<else/>
仅统计推广员自己 <span style="color: red;">不含其下属推广员</span>的游戏订单相关统计
</if>
<else/>
游戏订单统计
</if>
</p>
</div> </div>
<div class="cf top_nav_list"> <div class="cf top_nav_list">
@ -40,12 +54,52 @@
<div class="jssearch fl cf search_list"> <div class="jssearch fl cf search_list">
<!--游戏类型搜索END--> <!--游戏类型搜索END-->
<div class="input-list"> <div class="input-list search-title-box">
<a class="sch-btn" href="javascript:history.go(-1)" style="background:#fff;color: #000;border: #000 solid 1px;width: 100px">返回</a> <a class="sch-btn" href="javascript:history.go(-1)" style="background:#fff;color: #000;border: #000 solid 1px;width: 100px">返回</a>
</div> </div>
<input type="hidden" name="count_date" value="{$_GET['count_date']}"/> <div class="input-list search-title-box">
<input type="hidden" name="game_id" value="{$_GET['game_id']}"/> <label>搜索:</label>
<input type="hidden" name="game_name" value="{$_GET['game_name']}"/> </div>
<div class="input-list input-list-server search_label_rehab">
<select id="partner_id" name="partner_id" class="select_gallery" style="width:120px;">
<option value="">请选择合作公司</option>
<volist name=":getPartner()" id="vo">
<option partner-id="{$vo.id}" value="{$vo.id}" <if condition="$vo.id eq $_GET['partner_id']">selected=selected</if>>{$vo.partner}</option>
</volist>
</select>
</div>
<div class="input-list input-list-game search_label_rehab">
<select id="game_name" name="game_name" class="select_gallery" >
<option value="">游戏名称</option>
</select>
</div>
<div class="input-list input-list-game search_label_rehab">
<select id="game_type" name="game_type" class="select_gallery" >
<option value="">请选择设备类型</option>
<option value="1">安卓</option>
<option value="2">苹果</option>
</select>
</div>
<div class="input-list search_item input-list-gamenoticestatus">
<select name="promote_level" style="color:#444" class="select_gallery" id="promote_level">
<option value="">请选择推广员等级</option>
<option value="1" <?php if ($_POST['promote_level'] == 1):?>selected<?php endif;?>>会长</option>
<option value="2" <?php if ($_POST['promote_level'] == 2):?>selected<?php endif;?>>部门长</option>
<option value="3" <?php if ($_POST['promote_level'] == 3):?>selected<?php endif;?>>组长</option>
<option value="4" <?php if ($_POST['promote_level'] == 4):?>selected<?php endif;?>>组员</option>
</select>
-
</div>
<div class="input-list search_item input-list-gamenoticestatus">
<select name="promote_id" style="color:#444" class="select_gallery" id="promote_id">
<option value="">请选择推广员</option>
<option value="0" <?php if ($_POST['promote_id'] == 0):?>selected<?php endif;?>>官方渠道</option>
</select>
</div>
<input type="hidden" name="promote_type" value="{$_GET['promote_type']}"/>
<!-- <input type="hidden" name="promote_id" value="{$_GET['promote_id']}"/> -->
<!-- <input type="hidden" name="game_name" value="{$_GET['game_name']}"/> -->
<div class="input-list"> <div class="input-list">
<input type="text" name="pay_order_number" placeholder="请输入支付订单号" class="" value="{:I('pay_order_number')}" style="width: 180px"/>&nbsp; <input type="text" name="pay_order_number" placeholder="请输入支付订单号" class="" value="{:I('pay_order_number')}" style="width: 180px"/>&nbsp;
@ -199,7 +253,7 @@
</script> </script>
<script type="text/javascript"> <script type="text/javascript">
//导航高亮 //导航高亮
highlight_subnav('{:U('Finance/gameStatistics')}'); highlight_subnav('{:U("FinancePromote/index")}');
$(function(){ $(function(){
$('.page a').click(function () { $('.page a').click(function () {
@ -265,44 +319,56 @@
}); });
}); });
$("#game_id").change(function(){ function get_game_list()
{
var game_name = "{:I('game_name')}";
$.ajax({ $.ajax({
url:"{:U('Ajax/getSpendServer')}", url:"{:U('Finance/getGameList')}",
type:"post", type:"post",
data:{game_id:$("#game_id option:selected").attr('game-id')}, data:{partner_id:$("#partner_id option:selected").val(), sdk_type:$("#sdk_version1 option:selected").val()},
dataType:'json', dataType:'json',
success:function(data){ success:function(data){
str = "<option value=''>请选择区服</option>"; var str = "<option value=''>请选择游戏</option>";
for (var i in data){ for (var i in data){
str += "<option value='"+data[i].server_name+"'>"+data[i].server_name+"</option>" str += "<option value='"+data[i].game_name+"'"+(game_name && data[i].game_name == game_name?'selected':'')+">"+data[i].game_name+"</option>"
} }
$("#server_id").empty(); // console.log(str);
$("#server_id").append(str); $("#game_name").empty();
$("#server_id").select2(); $("#game_name").append(str);
// $("#server_id").select2();
} }
}) })
}
$("#partner_id").change(function(){
get_game_list();
}); });
var game_id = "{:I('game_name')}"; $("#partner_id").change();
var game_server = "{:I('server_id')}";
if(game_id){ var promote_id = "{:I('promote_id')}";
$("#promote_level").change(function(){
$.ajax({ $.ajax({
url:"{:U('Ajax/getSpendServer')}", url:"{:U('Ajax/getPromotersByLevel')}",
type:"post", type:"get",
data:{game_id:game_id,type:2}, data:{level:$("#promote_level option:selected").val()},
dataType:'json', dataType:'json',
success:function(data){ success:function(response){
str = "<option value=''>请选择区服</option>"; str = '<option value="">请选择推广员</option><option value="0"'+(promote_id && 0 == promote_id?'selected':'')+'>官方渠道</option>';
// $.each(response.data, function(index, item){
// console.log(item.id);
// str += '<option value="'+item.id+' '+(promote_id && item.id == promote_id?'selected':'')+'">'+item.nickname+'</option>';
// });
data = response.data;
for (var i in data){ 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>" str += "<option value='"+data[i].id+"' "+(promote_id && data[i].id == promote_id?'selected':'')+">"+data[i].nickname+"</option>"
} }
$("#server_id").empty(); $("#promote_id").empty();
$("#server_id").append(str); $("#promote_id").append(str);
$("#server_id").select2(); $("#promote_id").select2();
} }
}) })
} });
$("#promote_level").change();
}) })
</script> </script>
</block> </block>

@ -271,7 +271,7 @@
<script type="text/javascript"> <script type="text/javascript">
//导航高亮 //导航高亮
highlight_subnav('{:U('Member / user_info')}'); highlight_subnav('{:U("FinancePromote/index")}');
$(function () { $(function () {
<volist name=":I('get.')" id="vo"> <volist name=":I('get.')" id="vo">
Think.setValue('{$key}',"{$vo}"); Think.setValue('{$key}',"{$vo}");

@ -269,7 +269,7 @@
<script type="text/javascript"> <script type="text/javascript">
//导航高亮 //导航高亮
highlight_subnav('{:U('Member / user_info')}'); highlight_subnav('{:U("FinancePromote/index")}');
$(function () { $(function () {
<volist name=":I('get.')" id="vo"> <volist name=":I('get.')" id="vo">
Think.setValue('{$key}',"{$vo}"); Think.setValue('{$key}',"{$vo}");
@ -299,7 +299,13 @@
return false; return false;
} }
} }
window.location.href = url; window.location.replace(url);
// window.location.href = url;
});
$('.page a').click(function () {
var href = $(this).attr('href');
$(this).removeAttr('href');
window.location.replace(href)
}); });
$(".paixu").click(function () { $(".paixu").click(function () {
var that = $(this); var that = $(this);

Loading…
Cancel
Save