Merge remote-tracking branch 'origin/dev' into dev

master
liuweiwen 5 years ago
commit b1e9127e9d

@ -5,6 +5,15 @@ namespace Admin\Controller;
class BehaviorLogController extends ThinkController
{
private $single_type = [
0 => '通知到账',
1 => '补单',
];
/**
* 游戏预下单记录
* @return [type] [description]
*/
public function game()
{
$params = I('get.');
@ -67,7 +76,7 @@ class BehaviorLogController extends ThinkController
$data[$k]['server_name'] = '';
$data[$k]['game_player_name'] = '';
$data[$k]['game_player_id'] = '';
}
}
$count = M('pay_info', 'tab_')->where($map)->count();
@ -82,4 +91,77 @@ class BehaviorLogController extends ThinkController
$this->display('index');
}
/**
* 补单记录
* @return [type] [description]
*/
public function singleSupplement() {
$p = I('get.p', 1);
$row = I('get.row', 10);
$params = I('get.');
if(isset($params['timestart']) && isset($params['timeend'])) {
$startTime = strtotime($params['timestart']);
$endTime = strtotime($params['timeend']) + 86399;
$map['tab_repair_pay.create_time'] = array('BETWEEN', [$startTime, $endTime]);
}
if(isset($params['type'])) {
$map['tab_repair_pay.type'] = $params['type'];
}
if(isset($params['pay_order_number'])) {
$map['tab_repair_pay.pay_order_number'] = $params['pay_order_number'];
}
if(isset($params['admin_name'])) {
$map['tab_repair_pay.admin_name'] = $params['admin_name'];
}
if(!empty(I('get.order_number'))) {
$map['tab_spend.order_number'] = I('get.order_number');
$data = M('repair_pay', 'tab_')->join('tab_spend on tab_spend.pay_order_number = tab_repair_pay.pay_order_number')->where($map)->page($p, $row)->order('tab_repair_pay.id DESC')->select();
} else {
$data = M('repair_pay', 'tab_')->where($map)->page($p, $row)->order('id DESC')->select();
}
$show_data = [];
foreach($data as $k => $v) {
if($v['tab'] == 'spend') {
$order_detail = M('spend', 'tab_')->field('order_number,pay_time,user_account,promote_account,game_name,pay_amount,pay_way')->where(['pay_order_number' => $v['pay_order_number']])->find();
$re_data['pay_time'] = $order_detail['pay_time'];
} elseif($v['tab'] == 'deposit') {
$order_detail = M('deposit', 'tab_')->field('order_number,create_time,user_account,promote_account,pay_amount,pay_way')->where(['pay_order_number' => $v['pay_order_number']])->find();
$re_data['pay_time'] = $order_detail['create_time'];
}
$re_data['order_number'] = !empty($order_detail['order_number']) ? $order_detail['order_number'] : '-';
$re_data['user_account'] = $order_detail['user_account'];
$re_data['promote_account'] = $order_detail['promote_account'];
$re_data['game_name'] = !empty($order_detail['game_name']) ? $order_detail['game_name'] : '-';
$re_data['pay_amount'] = $order_detail['pay_amount'];
$re_data['pay_way'] = get_pay_way($order_detail['pay_way']);
$re_data['pay_order_number'] = $v['pay_order_number'];
$re_data['type'] = $this->single_type[$v['type']];
$re_data['create_time'] = $v['create_time'];
$re_data['admin_name'] = $v['admin_name'];
$show_data[] = $re_data;
}
if(!empty(I('get.order_number'))) {
$map['tab_spend.order_number'] = I('get.order_number');
$count = M('repair_pay', 'tab_')->join('tab_spend on tab_spend.pay_order_number = tab_repair_pay.pay_order_number')->where($map)->count();
} else {
$count = M('repair_pay', 'tab_')->where($map)->count();
}
$page = set_pagination($count, $row);
if ($page) {
$this->assign('_page', $page);
}
$this->assign('show_data', $show_data);
$this->display('singleSupplement');
}
}

@ -2097,6 +2097,70 @@ class ExportController extends Controller
$xlsData[0]['money_all'] = $xlsData[0]['buy_num'] * 10;
$xlsData[0]['authorization_all_num'] = $authorization_all_num;
break;
case 25:
$xlsCell = array(
array('type', '类型'),
array('pay_order_number', '支付订单号'),
array('order_number', 'CP订单号'),
array('pay_time', '充值时间'),
array('user_account', '玩家账号'),
array('promote_account', '所属推广员'),
array('game_name', '游戏名称'),
array('pay_amount', '实付金额'),
array('pay_way', '充值方式'),
array('admin_name', '补单管理员'),
array('create_time', '补单时间'),
);
$params = I('get.');
if(isset($params['timestart']) && isset($params['timeend'])) {
$startTime = strtotime($params['timestart']);
$endTime = strtotime($params['timeend']) + 86399;
$map['tab_repair_pay.create_time'] = array('BETWEEN', [$startTime, $endTime]);
}
if(isset($params['type'])) {
$map['tab_repair_pay.type'] = $params['type'];
}
if(isset($params['pay_order_number'])) {
$map['tab_repair_pay.pay_order_number'] = $params['pay_order_number'];
}
if(isset($params['admin_name'])) {
$map['tab_repair_pay.admin_name'] = $params['admin_name'];
}
if(!empty(I('get.order_number'))) {
$map['tab_spend.order_number'] = I('get.order_number');
$data = M('repair_pay', 'tab_')->join('tab_spend on tab_spend.pay_order_number = tab_repair_pay.pay_order_number')->where($map)->page($p, $row)->order('tab_repair_pay.id DESC')->select();
} else {
$data = M('repair_pay', 'tab_')->where($map)->page($p, $row)->order('id DESC')->select();
}
$xlsData = [];
foreach($data as $k => $v) {
if($v['tab'] == 'spend') {
$order_detail = M('spend', 'tab_')->field('order_number,pay_time,user_account,promote_account,game_name,pay_amount,pay_way')->where(['pay_order_number' => $v['pay_order_number']])->find();
$re_data['pay_time'] = set_show_time($order_detail['pay_time']);
} elseif($v['tab'] == 'deposit') {
$order_detail = M('deposit', 'tab_')->field('order_number,create_time,user_account,promote_account,pay_amount,pay_way')->where(['pay_order_number' => $v['pay_order_number']])->find();
$re_data['pay_time'] = set_show_time($order_detail['create_time']);
}
$re_data['order_number'] = !empty($order_detail['order_number']) ? $order_detail['order_number'] : '-';
$re_data['user_account'] = $order_detail['user_account'];
$re_data['promote_account'] = $order_detail['promote_account'];
$re_data['game_name'] = !empty($order_detail['game_name']) ? $order_detail['game_name'] : '-';
$re_data['pay_amount'] = $order_detail['pay_amount'];
$re_data['pay_way'] = get_pay_way($order_detail['pay_way']);
$re_data['pay_order_number'] = $v['pay_order_number'];
$re_data['type'] = $v['type'] == 1 ? '补单' : '通知到账';
$re_data['create_time'] = set_show_time($v['create_time']);
$re_data['admin_name'] = $v['admin_name'];
$xlsData[] = $re_data;
}
break;
default:
$xlsName = $xlsCell = $xlsData = [];

@ -3,6 +3,7 @@
namespace Admin\Controller;
use User\Api\UserApi as UserApi;
use Common\Api\GameApi;
use Callback\Controller\BaseController;
/**
* 后台首页控制器
* @author 麦当苗儿 <zuojiazi@vip.qq.com>
@ -17,7 +18,20 @@ class RepairController extends ThinkController {
$result=$game->game_pay_notify($param,1);
}
$spend = M('Spend',"tab_");
if($result == "success"){
$auth = session('user_auth');
// 补单记录
M('repair_pay', 'tab_')->add([
'admin_id' => $auth['uid'],
'admin_name' => $auth['username'],
'pay_order_number' => $orderNo,
'ip' => get_client_ip(),
'tab' => 'spend',
'create_time' => time(),
'type' => 1 // 补单
]);
$rr = $spend->where(array('pay_order_number'=>$orderNo))->save(array('pay_game_status'=>1));
$this->ajaxReturn(array('status'=>1,'msg'=>'补单成功'));
}else{
@ -97,6 +111,107 @@ class RepairController extends ThinkController {
}
/**
* 游戏充值补单
*/
public function noticePayed($orderNo, $second, $type) {
$auth = session('user_auth');
if (IS_AJAX) {
if ($type != 'spend' && $type != 'deposit') {
$this->ajaxReturn(['status'=>0,'msg'=>'参数有误']);
}
$tab = $type;
if (!$orderNo || !$second) {
$this->ajaxReturn(['status'=>0,'msg'=>'参数不足']);
}
$r = D('Member')->check_sc_pwd($second);
if (!$r) {
$this->ajaxReturn(['status'=>0,'msg'=>'二级密码错误']);
}
M($tab, 'tab_')->startTrans();
$order = M($tab, 'tab_')->where(['pay_order_number' => $orderNo])->find();
if ($order['pay_status'] == 1) {
M($tab, 'tab_')->rollback();
$this->ajaxReturn(['status'=>0,'msg'=>'支付成功,无需补单']);
}
$r = M($tab, 'tab_')->where([
'pay_order_number' => $orderNo,
'pay_status' => 0
])->save([
'pay_status' => 1
]);
if ($r) {
$cpFlag = 0; // 0 通知cp失败 1 成功
// 通知cp
if ($tab == 'spend') {
$param['out_trade_no'] = $orderNo;
$game = new GameApi();
$result=$game->game_pay_notify($param,1);
$spend = M($tab, "tab_");
if($result == "success"){
$rr = $spend->where(array('pay_order_number'=>$orderNo))->save(array('pay_game_status'=>1));
if ($rr) {
$cpFlag = 1;
M('spend', 'tab_')->commit();
} else {
M($tab, 'tab_')->rollback();
$this->ajaxReturn(array('status'=>1,'msg'=>'补单失败.'));
}
}else{
M($tab, 'tab_')->commit();
}
} else { // deposit
M('spend', 'tab_')->commit();
}
// 通知到账记录
M('repair_pay', 'tab_')->add([
'admin_id' => $auth['uid'],
'admin_name' => $auth['username'],
'pay_order_number' => $orderNo,
'ip' => get_client_ip(),
'tab' => $tab,
'create_time' => time(),
'type' => 0
]);
if ($tab == 'spend' && $cpFlag === 1) {
// 补单记录
M('repair_pay', 'tab_')->add([
'admin_id' => $auth['uid'],
'admin_name' => $auth['username'],
'pay_order_number' => $orderNo,
'ip' => get_client_ip(),
'tab' => $tab,
'create_time' => time(),
'type' => 1
]);
}
// todo: 分红 上级奖励等
if ($tab == 'spend' && $cpFlag == 0) {
$this->ajaxReturn(['status'=>0,'msg'=>'充值补单成功通知CP失败']);
}
$this->ajaxReturn(['status'=>0,'msg'=>'充值补单成功!']);
} else {
M('spend', 'tab_')->rollback();
$this->ajaxReturn(['status'=>0,'msg'=>'补单失败,请重试']);
}
}
}
/**
* 平台币充值补单
*/
public function platform($orderNo) {
if (IS_AJAX) {
$payOrderNumber = I('request.pay_order_number');
}
}
}

@ -131,5 +131,14 @@ class SpendController extends ThinkController
$this->assign('is_admin', is_administrator());
$this->display();
}
/**
* 充值补单功能
*/
public function order_repair() {
if (IS_AJAX) {
}
}
}

@ -5,6 +5,7 @@ use Admin\Model\SpendModel;
use Open\Model\UserLoginRecordModel;
use Admin\Model\UserPlayModel;
use User\Api\UserApi as UserApi;
use GuzzleHttp\Client;
/**
* 后台首页控制器
@ -113,7 +114,85 @@ class StatController extends ThinkController
$this->display();
}
}
public function multisort($records, $column, $type = 'asc')
{
$records = index_by_column($column, $records);
// var_dump($records);die();
if ($type == 'asc') {
ksort($records);
} else {
krsort($records);
}
return array_values($records);
}
public function userretention()
{
$this->meta_title = '留存统计';
$start = I('start', date('Y-m-d',strtotime('-7 day')));
$end = empty(I('end')) ? time_format(time(),'Y-m-d') : I('end');
$dataOrder = I('data_order', '');
$gameId = I('game_id', 0);
$status = true;
$data = false;
$error = '';
if ($gameId == 0) {
$error = '请选择游戏!';
$status = false;
}
$startTime = strtotime($start . ' 00:00:00');
$endTime = strtotime($end . ' 23:59:59') + 1;
if ((($endTime - $startTime)/(24*3600)) > 31) {
$error = '时间间隔不能超过31天';
$status = false;
}
if ($status) {
$client = new Client([
'base_uri' => C('PACKAGE_SERVER_URL'),
'timeout' => 10.0,
]);
$response = $client->post('/statistics/player-retention', [
'verify' => false,
'form_params' => [
'start_time' => $start,
'end_time' => $end,
'promote_id' => I('promote_id', 0),
'game_id' => $gameId,
]
]);
$result = (string)$response->getBody();
$result = json_decode($result, true);
if (!$result) {
$this->assign('error', '数据请求异常!');
}
$data = $result['data']['records'];
$dayList = [1, 2, 3, 4, 5, 6, 7, 15, 30];
foreach ($data as $key => $item) {
foreach ($dayList as $day) {
if ($item['register_count'] > 0) {
$item['retention_day'. $day] = round($item['retention_day'. $day]/$item['register_count'], 4)*100;
} else {
$item['retention_day'. $day] = '--';
}
}
$data[$key] = $item;
}
if ($dataOrder) {
$data = $this->multisort($data, $dataOrder);
}
} else {
$this->assign('error', $error);
}
$this->assign('data', $data);
$this->meta_title = '留存统计';
$this->display();
}
/**
* 留存统计
@ -121,7 +200,7 @@ class StatController extends ThinkController
* 06.12.3
* xmy
*/
public function userretention($p = 0)
public function playerRetention($p = 0)
{
echo "暂不开放";
die();

@ -0,0 +1,373 @@
<extend name="Public/base"/>
<block name="body">
<link rel="stylesheet" href="__CSS__/select2.min.css" type="text/css"/>
<script type="text/javascript" src="__JS__/bootstrap.min.js"></script>
<script type="text/javascript" src="__JS__/select2.min.js"></script>
<style>
.select2-container--default .select2-selection--single {
color: #000;
resize: none;
border-width: 1px;
border-style: solid;
border-color: #a7b5bc #ced9df #ced9df #a7b5bc;
box-shadow: 0px 3px 3px #F7F8F9 inset;height:35px;
height:28px;border-radius:3px;font-size:12px;
}
.select2-container--default .select2-selection--single .select2-selection__rendered {
line-height:35px;
line-height:28px;
}
.select2-container--default .select2-selection--single .select2-selection__arrow {
height:26px;
}
.select2-container--default .select2-search--dropdown .select2-search__field {
height:26px;line-height:26px;font-size:12px;
}
.select2-results__option[aria-selected] {font-size:12px;}
</style>
<!-- 标题栏 -->
<div class="cf main-place top_nav_list navtab_list">
<h3 class="page_title">补单记录</h3>
<p class="description_text">说明:玩家充值失败管理员进行手动补单的记录</p>
</div>
<div class="cf top_nav_list">
<!-- 高级搜索 -->
<div class="jssearch fl cf search_list">
<div class="input-list search-title-box">
<label>搜索:</label>
</div>
<div class="input-list input-list-game search_label_rehab">
<select id="type" name="type" class="select_gallery" >
<option value="">请选择补单类型</option>
<option value="0" <?php I('game_type',-1) == 0 ? "selected" : ''?>>通知到账</option>
<option value="1" <?php echo I('game_type') == 1 ? "selected" : ''?>>补单</option>
</select>
</div>
<div class="input-list">
<input type="text" name="pay_order_number" class="" value="{:I('pay_order_number')}" placeholder="支付订单号">
</div>
<div class="input-list">
<input type="text" name="order_number" class="" value="{:I('order_number')}" placeholder="CP订单号">
</div>
<div class="input-list input-list-game search_label_rehab">
<select id="admin_name" name="admin_name" class="select_gallery" >
<option value="">补单管理员搜索</option>
<volist name=":get_admin_list()" id="vo">
<option value="{$vo.nickname}" <?php echo $vo.admin_name == I('nickname') ? 'selected':''; ?> >{$vo.nickname}</option>
</volist>
</select>
</div>
<div class="input-list">
<input type="text" readonly id="time-start" name="timestart" class="" value="{$startDate}"
placeholder="补单开始时间"/>
-
<div class="input-append date" id="datetimepicker" style="display:inline-block">
<input type="text" readonly id="time-end" name="timeend" class="" value="{$endDate}"
placeholder="补单结束时间"/>
<span class="add-on"><i class="icon-th"></i></span>
</div>
</div>
<input type="hidden" name="" value="" class="sortBy">
<div class="input-list search_item">
<a class="sch-btn" href="javascript:;" id="search"
url="{:U('BehaviorLog/singleSupplement','model='.$model['name'] . '&row='.I('row'),false)}">搜索</a>
</div>
</div>
</div>
<!-- 数据列表 -->
<div class="data_list zdata_list">
<div class="">
<table>
<!-- 表头 -->
<thead>
<tr>
<th>类型</th>
<th>支付订单号</th>
<th>CP订单号</th>
<th>充值时间</th>
<th>玩家账号</th>
<th>所属推广员</th>
<th>游戏名称</th>
<th>实付金额</th>
<th>充值方式</th>
<th>补单管理员</th>
<th>补单时间</th>
</tr>
</thead>
<!-- 列表 -->
<tbody>
<empty name="show_data">
<td colspan="11" class="text-center">aOh! 暂时还没有内容!</td>
<else/>
<volist name="show_data" id="vo">
<tr>
<td>{$vo.type}</td>
<td>{$vo.pay_order_number}</td>
<td>{$vo.order_number}</td>
<td>{:set_show_time($vo['pay_time'])}</td>
<td>{$vo.user_account}</td>
<td>{$vo.promote_account}</td>
<td>{$vo.game_name}</td>
<td>{$vo.pay_amount}</td>
<td>{$vo.pay_way}</td>
<td>{$vo.admin_name}</td>
<td>{:set_show_time($vo['create_time'])}</td>
</tr>
</volist>
</empty>
</tbody>
</table>
</div>
</div>
<div class="page">
<a class="sch-btn" href="{:U('Export/expUser',array_merge(array('id'=>25,'xlsname'=>'补单记录'),I('get.')))}">导出</a>
{$_page|default=''}
</div>
<div class="common_settings">
<span class="plus_icon"><span><img src="__IMG__/zwmimages/icon_jia.png"></span></span>
<form class="addShortcutIcon">
<input type="hidden" name="title" value="{$m_title}">
<input type="hidden" name="url" value="Spend/lists">
</form>
<a class="ajax-post add-butn <notempty name='commonset'>addSIsetted</notempty>" href="javascript:;" target-form="addShortcutIcon" url="{:U('Think/addShortcutIcon')}"><img src="__IMG__/zwmimages/icon_jia.png"><span><notempty name='commonset'>已添加<else />添加至常用设置</notempty></span></a>
</div>
</block>
<block name="script">
<link href="__STATIC__/datetimepicker/css/datetimepicker.css" rel="stylesheet" type="text/css">
<php>if(C('COLOR_STYLE')=='blue_color') echo '
<link href="__STATIC__/datetimepicker/css/datetimepicker_blue.css" rel="stylesheet" type="text/css">
';
</php>
<link href="__STATIC__/datetimepicker/css/dropdown.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="__STATIC__/datetimepicker/js/bootstrap-datetimepicker.min.js"></script>
<script type="text/javascript" src="__STATIC__/datetimepicker/js/locales/bootstrap-datetimepicker.zh-CN.js"
charset="UTF-8"></script>
<script src="__STATIC__/layer/layer.js" type="text/javascript"></script>
<script>
<volist name = ":I('get.')" id = "vo">
Think.setValue('{$key}', "{$vo}");
</volist>
$(".select_gallery").select2();
</script>
<script type="text/javascript">
//导航高亮
highlight_subnav('{:U('BehaviorLog/singleSupplement')}');
$(function () {
//搜索功能
$("#search").click(function () {
var url = $(this).attr('url');
var query = $('.jssearch').find('input').serialize();
query += "&" + $('.jssearch').find('select').serialize();
query = query.replace(/(&|^)(\w*?\d*?\-*?_*?)*?=?((?=&)|(?=$))/g, '');
query = query.replace(/^&/g, '');
if (url.indexOf('?') > 0) {
url += '&' + query;
} else {
url += '?' + query;
}
window.location.href = url;
});
$(".paixu").click(function () {
var that = $(this);
$data_order = that.attr('data-order');
$order_type = '{$userarpu_order}';
if ($order_type == '' || $order_type == '4') {
$(".sortBy").attr('name', 'data_order');
val = '3,' + $data_order;
$(".sortBy").attr('value', val);
$("#search").click();
} else if ($order_type == '3') {
$(".sortBy").attr('name', 'data_order');
val = '4,' + $data_order;
$(".sortBy").attr('value', val);
$("#search").click();
}
});
//回车自动提交
$('.jssearch').find('input').keyup(function (event) {
if (event.keyCode === 13) {
$("#search").click();
}
});
$('#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;
});
$(".budan").click(function () {
url = $(this).attr('href-hhh');
data = $(this).attr('href-data');
$.ajax({
type: 'post',
url: url,
data: {orderNo: data},
success: function (e) {
if (e.status == 1) {
layer.msg(e.msg, {icon: 1});
setTimeout(function () {
location.reload();
}, 1500);
} else {
layer.msg(e.msg, {icon: 2});
}
},
});
});
$(".budan2").click(function () {
url = $(this).attr('href-hhh');
data = $(this).attr('href-data');
$.ajax({
type: 'post',
url: url,
data: {orderNo: data},
success: function (e) {
if (e.status == 1) {
if (e.msg.length > 30) {
window.open(e.msg);
} else {
layer.msg(e.msg, {icon: 1});
setTimeout(function () {
location.reload();
}, 1500);
}
} else {
layer.msg(e.msg, {icon: 2});
}
},
});
});
$(".d_list").find(".drop-down11").hover(function () {
$(this).find(".nav-list").removeClass("hidden");
}, function () {
$(this).find(".nav-list").addClass("hidden");
});
$(".drop-down11 .nav-list li").find("a").each(function () {
var that = $(".drop-down11");
$(this).click(function () {
var text = $(this).text(), val = $(this).attr("value");
that.find(".sort-txt").text(text).attr("data", val);
that.find(".nav-list").addClass("hidden");
that.siblings('.hiddenvalue').val(val);
})
});
$(".d_list").find(".drop-down12").hover(function () {
$(this).find(".nav-list").removeClass("hidden");
}, function () {
$(this).find(".nav-list").addClass("hidden");
});
$(".drop-down12 .nav-list li").find("a").each(function () {
var that = $(".drop-down12");
$(this).click(function () {
var text = $(this).text(), val = $(this).attr("value");
that.find(".sort-txt").text(text).attr("data", val);
that.find(".nav-list").addClass("hidden");
that.siblings('.hiddenvalue').val(val);
})
});
$(".d_list").find(".drop-down13").hover(function () {
$(this).find(".nav-list").removeClass("hidden");
}, function () {
$(this).find(".nav-list").addClass("hidden");
});
$(".drop-down13 .nav-list li").find("a").each(function () {
var that = $(".drop-down13");
$(this).click(function () {
var text = $(this).text(), val = $(this).attr("value");
that.find(".sort-txt").text(text).attr("data", val);
that.find(".nav-list").addClass("hidden");
that.siblings('.hiddenvalue').val(val);
})
});
//下拉内容框
$(".drop-down2").on('click', function (event) {
var navlist = $(this).find('.i_list_li');
if (navlist.hasClass('hidden')) {
navlist.removeClass('hidden');
$('#i_list_id').focus().val('');
} else {
navlist.addClass('hidden');
}
$(document).one("click", function () {
navlist.addClass('hidden');
});
event.stopPropagation();
});
$('#i_list_id').on('keyup', function (event) {
var val = $.trim($(this).val()).toLowerCase();
$('#i_list_idh').val(val);
});
$("#i_list_li").find("a").each(function () {
$(this).click(function () {
var text = $.trim($(this).text()).toLowerCase();
$("#i_list_id").val(text);
$('#i_list_idh').val(text);
})
});
})
/**
* 初始化select2单选默认带搜索功能。
*/
//初始化页面加载
$(document).ready(function () {
});
</script>
</block>

@ -127,6 +127,7 @@
</a>
</th>
<th>订单状态</th>
<th>操作</th>
</tr>
</thead>
@ -168,6 +169,16 @@
{:get_info_status($data['pay_status'],9)}
</if>
</td>
<td style="text-indent:0;">
<br />
<if condition="$data['pay_status'] eq 0">
<a class="pay_repair" href="javascript:void(0);"
href-data="{$data.pay_order_number}" href-hhh="{:U('Repair/noticePayed')}" style="width:100%;">通知到账</a>
</if>
</td>
</tr>
</volist>
</empty>
@ -397,5 +408,36 @@
// minimumResultsForSearch: Infinity, // 永久隐藏搜索框
// });
}
// 充值补单
$(".pay_repair").click(function () {
url = $(this).attr('href-hhh');
data = $(this).attr('href-data');
var pwd2 = prompt("请输入二级密码");
if (!pwd2) {
alert("二级密码不能为空");
return ;
}
$.ajax({
type: 'post',
url: url,
data: {orderNo: data, second: pwd2, type: 'deposit'},
success: function (e) {
if (e.status == 1) {
layer.msg(e.msg, {icon: 1});
setTimeout(function () {
location.reload();
}, 1500);
} else {
if (e.msg) {
var tip_msg = e.msg;
} else {
var tip_msg = e.info ? e.info : "补单失败";
}
layer.msg(tip_msg, {icon: 2});
}
},
});
});
</script>
</block>

@ -224,7 +224,7 @@
</volist>
</script>
<script type="text/javascript">
$(".select_gallery").select2();
function reloadIframe(url) {
$("iframe").attr('src', url);
// document.getElementsByTagName('iframe').src=url;
@ -312,7 +312,7 @@
// console.log(str);
$("#game_name").empty();
$("#game_name").append(str);
// $("#server_id").select2();
$("#game_name").select2();
}
})

@ -240,10 +240,11 @@
</volist>
</script>
<script type="text/javascript">
$(".select_gallery").select2();
//导航高亮
highlight_subnav('{:U("FinancePromote/index")}');
$(function(){
$('.page a:eq(1)').click(function () {
var href = $(this).attr('href');
$(this).removeAttr('href');
@ -323,7 +324,7 @@
// console.log(str);
$("#game_name").empty();
$("#game_name").append(str);
// $("#server_id").select2();
$("#game_name").select2();
}
})

@ -234,8 +234,15 @@
<span>补单</span>
</if>
<br />
<if condition="$data['pay_game_status'] eq 0 and $data['pay_status'] eq 0">
<a class="pay_repair" href="javascript:void(0);"
href-data="{$data.pay_order_number}" href-hhh="{:U('Repair/noticePayed')}" style="width:100%;">通知到账</a>
</if>
</td>
</tr>
</volist>
</empty>
@ -428,6 +435,37 @@
},
});
});
// 充值补单
$(".pay_repair").click(function () {
url = $(this).attr('href-hhh');
data = $(this).attr('href-data');
var pwd2 = prompt("请输入二级密码");
if (!pwd2) {
alert("二级密码不能为空");
return ;
}
$.ajax({
type: 'post',
url: url,
data: {orderNo: data, second: pwd2, type: 'spend'},
success: function (e) {
if (e.status == 1) {
layer.msg(e.msg, {icon: 1});
setTimeout(function () {
location.reload();
}, 1500);
} else {
if (e.msg) {
var tip_msg = e.msg;
} else {
var tip_msg = e.info ? e.info : "补单失败";
}
layer.msg(tip_msg, {icon: 2});
}
},
});
});
$(".d_list").find(".drop-down11").hover(function () {
$(this).find(".nav-list").removeClass("hidden");

@ -74,7 +74,7 @@
<!-- 表头 -->
<thead>
<tr>
<th ><a class="paixu" data-order='time'>日期</a></th>
<th ><a class="paixu" data-order='date'>日期</a></th>
<if condition="$game_name neq ''">
@ -86,53 +86,65 @@
<th>渠道名称</th>
</if>
<th ><a class="paixu" data-order='register_num'>新增玩家</a></th>
<th ><a class="paixu" data-order='register_count'>新增玩家</a></th>
<th ><a class="paixu" data-order='1'>1日留存</a></th>
<th ><a class="paixu" data-order='retention_day1'>1日留存</a></th>
<th ><a class="paixu" data-order='2'>2日留存</a></th>
<th ><a class="paixu" data-order='retention_day2'>2日留存</a></th>
<th ><a class="paixu" data-order='3'>3日留存</a></th>
<th ><a class="paixu" data-order='retention_day3'>3日留存</a></th>
<th ><a class="paixu" data-order='4'>4日留存</a></th>
<th ><a class="paixu" data-order='retention_day4'>4日留存</a></th>
<th ><a class="paixu" data-order='5'>5日留存</a></th>
<th ><a class="paixu" data-order='retention_day5'>5日留存</a></th>
<th ><a class="paixu" data-order='6'>6日留存</a></th>
<th ><a class="paixu" data-order='retention_day6'>6日留存</a></th>
<th ><a class="paixu" data-order='7'>7日留存</a></th>
<th ><a class="paixu" data-order='retention_day7'>7日留存</a></th>
<th ><a class="paixu" data-order='15'>15日留存</a></th>
<th ><a class="paixu" data-order='retention_day15'>15日留存</a></th>
<th ><a class="paixu" data-order='30'>30日留存</a></th>
<th ><a class="paixu" data-order='retention_day30'>30日留存</a></th>
</tr>
</thead>
<!-- 列表 -->
<tbody>
<empty name="data" >
<tr>
<td colspan="11" class="text-center">aOh! 暂时还没有内容!</td>
<td colspan="11" class="text-center"><?= $error ? '<span style="color: #ff0000;">' . $error . '</span>': 'aOh! 暂时还没有内容!' ?></td>
</tr>
<else />
<volist name="data" id="vo">
<tr>
<td>{$vo.time}</td>
<if condition="$game_name neq ''">
<td>{$vo.date}</td>
<if condition="$game_name neq ''">
<td>{$game_name}</td>
</if>
<if condition="$promote_name neq ''">
</if>
<if condition="$promote_name neq ''">
<td>{$promote_name}</td>
</if>
<td>{$vo.register_num}</td>
<td>{:round($vo['1']/$vo['register_num'],4)*100}%</td>
<td>{:round($vo['2']/$vo['register_num'],4)*100}%</td>
<td>{:round($vo['3']/$vo['register_num'],4)*100}%</td>
<td>{:round($vo['4']/$vo['register_num'],4)*100}%</td>
<td>{:round($vo['5']/$vo['register_num'],4)*100}%</td>
<td>{:round($vo['6']/$vo['register_num'],4)*100}%</td>
<td>{:round($vo['7']/$vo['register_num'],4)*100}%</td>
<td>{:round($vo['15']/$vo['register_num'],4)*100}%</td>
<td>{:round($vo['30']/$vo['register_num'],4)*100}%</td>
</if>
<td>{$vo.register_count}</td>
<?php if ($vo['register_count']>0):?>
<td>{$vo['retention_day1']}%</td>
<td>{$vo['retention_day2']}%</td>
<td>{$vo['retention_day3']}%</td>
<td>{$vo['retention_day4']}%</td>
<td>{$vo['retention_day5']}%</td>
<td>{$vo['retention_day6']}%</td>
<td>{$vo['retention_day7']}%</td>
<td>{$vo['retention_day15']}%</td>
<td>{$vo['retention_day30']}%</td>
<?php else:?>
<td>--</td>
<td>--</td>
<td>--</td>
<td>--</td>
<td>--</td>
<td>--</td>
<td>--</td>
<td>--</td>
<td>--</td>
<?php endif;?>
</tr>
</volist>
</empty>
@ -141,15 +153,14 @@
</div>
</div>
<div class="page">
<a class="sch-btn" href="{:U('Export/userretention_export',
array(
'start' =>I('start',date('Y-m-d',strtotime('-7 day'))),
'end' =>I('end',date('Y-m-d',time())),
'game_id'=>I('game_id'),
'promote_id'=>I('promote_id'),
'xlsname'=>'数据分析_留存率分析',)
,false)}">导出</a>
{$_page|default=''}
<a class="sch-btn" href="{:U('Export/userretention_export',
array(
'start' =>I('start',date('Y-m-d',strtotime('-7 day'))),
'end' =>I('end',date('Y-m-d',time())),
'game_id'=>I('game_id'),
'promote_id'=>I('promote_id'),
'xlsname'=>'数据分析_留存率分析',)
,false)}">导出</a>
</div>
</block>
@ -169,7 +180,7 @@ $(".select_gallery").select2();
<script src="__STATIC__/layer/layer.js" type="text/javascript"></script>
<script type="text/javascript">
//导航高亮
highlight_subnav('{:U('stat/userretention')}');
highlight_subnav("{:U('stat/userretention')}");
$(function(){
//搜索功能
$("#search").click(function(){
@ -219,17 +230,9 @@ $(function(){
var that=$(this);
$data_order=that.attr('data-order');
$order_type='{$userarpu_order}';
if($order_type==''||$order_type=='4'){
$(".sortBy").attr('name','data_order');
val='3,'+$data_order;
$(".sortBy").attr('value',val);
$("#search").click();
}else if($order_type=='3'){
$(".sortBy").attr('name','data_order');
val='4,'+$data_order;
$(".sortBy").attr('value',val);
$("#search").click();
}
$(".sortBy").attr('name','data_order');
$(".sortBy").attr('value',$data_order);
$("#search").click();
});
//回车自动提交
$('.jssearch').find('input').keyup(function(event){

@ -0,0 +1,338 @@
<extend name="Public/base"/>
<block name="body">
<link rel="stylesheet" href="__CSS__/select2.min.css" type="text/css" />
<script type="text/javascript" src="__JS__/bootstrap.min.js"></script>
<script type="text/javascript" src="__JS__/select2.min.js"></script>
<style>
.select2-container--default .select2-selection--single {
color: #000;
resize: none;
border-width: 1px;
border-style: solid;
border-color: #a7b5bc #ced9df #ced9df #a7b5bc;
box-shadow: 0px 3px 3px #F7F8F9 inset;height:35px;
height:28px;border-radius:3px;font-size:12px;
}
.select2-container--default .select2-selection--single .select2-selection__rendered {
line-height:35px;
line-height:28px;
}
.select2-container--default .select2-selection--single .select2-selection__arrow {
height:26px;
}
.select2-container--default .select2-search--dropdown .select2-search__field {
height:26px;line-height:26px;font-size:12px;
}
.select2-results__option[aria-selected] {font-size:12px;}
</style>
<div class="cf main-place top_nav_list navtab_list">
<h3 class="page_title">留存率分析</h3>
<p class="description_text">说明:根据日期,游戏,推广员分析用户留存率信息</p>
</div>
<div class="cf top_nav_list">
<!-- 高级搜索 -->
<div class="jssearch fl cf search_list">
<div class="input-list search-title-box">
<label>搜索:</label>
</div>
<div class="input-list">
<input type="text" id="time-start" name="start" class="" value="{:I('start',date('Y-m-d',strtotime('-7 day')))}" placeholder="选择开始时间" />
&nbsp;-&nbsp;
<input type="text" id="time-end" name="end" class="" value="{:I('end',date('Y-m-d',time()))}" placeholder="选择结束时间" />
</div>
<div class="input-list search_label_rehab">
<select id="game_id" name="game_id" class="select_gallery">
<option value="">请选择游戏</option>
<volist name=":get_game_list()" id="vo">
<option game-id="{$vo.id}" value="{$vo.id}">{$vo.game_name}</option>
</volist>
</select>
</div>
<div class="input-list input-list-promote search_label_rehab">
<select id="promote_id" name="promote_id" class="select_gallery" >
<option value="">推广员账号</option>
<volist name=":get_promote_list()" id="vo">
<option promote-id="{$vo.id}" value="{$vo.id}">{$vo.account}</option>
</volist>
</select>
</div>
<input type="hidden" name="" value="" class="sortBy">
<div class="input-list">
<a class="sch-btn" href="javascript:;" id="search" url="{:U('stat/userretention','model='.$model['name'].'&row='.I('row'),false)}">搜索</a>
</div>
</div>
</div>
<!-- 数据列表 -->
<div class="data_list">
<div class="">
<table>
<!-- 表头 -->
<thead>
<tr>
<th ><a class="paixu" data-order='time'>日期</a></th>
<if condition="$game_name neq ''">
<th>游戏名称</th>
</if>
<if condition="$promote_name neq ''">
<th>渠道名称</th>
</if>
<th ><a class="paixu" data-order='register_num'>新增玩家</a></th>
<th ><a class="paixu" data-order='1'>1日留存</a></th>
<th ><a class="paixu" data-order='2'>2日留存</a></th>
<th ><a class="paixu" data-order='3'>3日留存</a></th>
<th ><a class="paixu" data-order='4'>4日留存</a></th>
<th ><a class="paixu" data-order='5'>5日留存</a></th>
<th ><a class="paixu" data-order='6'>6日留存</a></th>
<th ><a class="paixu" data-order='7'>7日留存</a></th>
<th ><a class="paixu" data-order='15'>15日留存</a></th>
<th ><a class="paixu" data-order='30'>30日留存</a></th>
</tr>
</thead>
<!-- 列表 -->
<tbody>
<empty name="data" >
<tr>
<td colspan="11" class="text-center">aOh! 暂时还没有内容!</td>
</tr>
<else />
<volist name="data" id="vo">
<tr>
<td>{$vo.time}</td>
<if condition="$game_name neq ''">
<td>{$game_name}</td>
</if>
<if condition="$promote_name neq ''">
<td>{$promote_name}</td>
</if>
<td>{$vo.register_num}</td>
<td>{:round($vo['1']/$vo['register_num'],4)*100}%</td>
<td>{:round($vo['2']/$vo['register_num'],4)*100}%</td>
<td>{:round($vo['3']/$vo['register_num'],4)*100}%</td>
<td>{:round($vo['4']/$vo['register_num'],4)*100}%</td>
<td>{:round($vo['5']/$vo['register_num'],4)*100}%</td>
<td>{:round($vo['6']/$vo['register_num'],4)*100}%</td>
<td>{:round($vo['7']/$vo['register_num'],4)*100}%</td>
<td>{:round($vo['15']/$vo['register_num'],4)*100}%</td>
<td>{:round($vo['30']/$vo['register_num'],4)*100}%</td>
</tr>
</volist>
</empty>
</tbody>
</table>
</div>
</div>
<div class="page">
<a class="sch-btn" href="{:U('Export/userretention_export',
array(
'start' =>I('start',date('Y-m-d',strtotime('-7 day'))),
'end' =>I('end',date('Y-m-d',time())),
'game_id'=>I('game_id'),
'promote_id'=>I('promote_id'),
'xlsname'=>'数据分析_留存率分析',)
,false)}">导出</a>
{$_page|default=''}
</div>
</block>
<block name="script">
<script src="__STATIC__/layer/layer.js"></script>
<script>
<volist name=":I('get.')" id="vo">
Think.setValue('{$key}',"{$vo}");
</volist>
$(".select_gallery").select2();
</script>
<link href="__STATIC__/datetimepicker/css/datetimepicker.css" rel="stylesheet" type="text/css">
<php>if(C('COLOR_STYLE')=='blue_color') echo '<link href="__STATIC__/datetimepicker/css/datetimepicker_blue.css" rel="stylesheet" type="text/css">';</php>
<link href="__STATIC__/datetimepicker/css/dropdown.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="__STATIC__/datetimepicker/js/bootstrap-datetimepicker.min.js"></script>
<script type="text/javascript" src="__STATIC__/datetimepicker/js/locales/bootstrap-datetimepicker.zh-CN.js" charset="UTF-8"></script>
<script src="__STATIC__/layer/layer.js" type="text/javascript"></script>
<script type="text/javascript">
//导航高亮
highlight_subnav('{:U('stat/userretention')}');
$(function(){
//搜索功能
$("#search").click(function(){
//计算天数差的函数,通用
function GetDateDiff(startDate,endDate)
{
var startTime = new Date(Date.parse(startDate.replace(/-/g, "/"))).getTime();
var endTime = new Date(Date.parse(endDate.replace(/-/g, "/"))).getTime();
var dates = Math.abs((startTime - endTime))/(1000*60*60*24);
return dates;
}
var start = $("#time-start").val();
start = start.substring(0,19);
var end = ($("#time-end").val() == "") ? "{:date('Y-m-d')}" : $("#time-end").val();
end = end.substring(0,19);
var interval = GetDateDiff(end,start);
if(interval < 0 || start == ''){
layer.msg('请选择搜索时间');
return false;
}else if(interval>90){
layer.msg('请选择90日内的时间段');
return false;
}
var url = $(this).attr('url');
var query = $('.jssearch').find('input').serialize();
query += "&"+$('.jssearch').find('select').serialize();
query = query.replace(/(&|^)(\w*?\d*?\-*?_*?)*?=?((?=&)|(?=$))/g,'');
query = query.replace(/^&/g,'');
if( url.indexOf('?')>0 ){
url += '&' + query;
}else{
url += '?' + query;
}
if (start !='' && end != ''){
if (Date.parse(start) > Date.parse(end)){
layer.msg('开始时间必须小于等于结束时间');
return false;
}
}
window.location.href = url;
});
$(".paixu").click(function(){
var that=$(this);
$data_order=that.attr('data-order');
$order_type='{$userarpu_order}';
if($order_type==''||$order_type=='4'){
$(".sortBy").attr('name','data_order');
val='3,'+$data_order;
$(".sortBy").attr('value',val);
$("#search").click();
}else if($order_type=='3'){
$(".sortBy").attr('name','data_order');
val='4,'+$data_order;
$(".sortBy").attr('value',val);
$("#search").click();
}
});
//回车自动提交
$('.jssearch').find('input').keyup(function(event){
if(event.keyCode===13){
$("#search").click();
}
});
$('#time-start').datetimepicker({
format: 'yyyy-mm-dd',
language:"zh-CN",
minView:2,
autoclose:true
});
$('#time-end').datetimepicker({
format: 'yyyy-mm-dd',
language:"zh-CN",
minView:2,
autoclose:true,
pickerPosition:'bottom-left'
})
$(".chakan").click(function() {
that = $(this);
url = that.attr('href-url');
timetitle=that.attr('timetitle');
ptitle=' '+that.attr('ptitle')+' ';
layer.open({
type: 2,
title: false,
closeBtn: 0, //不显示关闭按钮
shade: [0],
area: ['1px', '1px'],
offset: 'rb', //右下角弹出
time: 1, // 秒后自动关闭 这里设置成1ms 不显示过度页面
anim: 2,
content: ['', 'no'], //iframe的urlno代表不显示滚动条
end: function(){ //
layer.open({
type: 2,
title: timetitle+ptitle+'游戏数据',
shadeClose: true,
shade: false,
maxmin: true, //开启最大化最小化按钮
area: ['50%', '45%'],
content: url//iframe的url
});
}
});
});
$("#game").on('click',function(event) {
var navlist = $(this).find('.i_list_li');
if (navlist.hasClass('hidden')) {
navlist.removeClass('hidden');
$(this).find('#i_list_id').focus().val('');
} else {
navlist.addClass('hidden');
}
$(document).one("click", function(){
navlist.addClass('hidden');
});
event.stopPropagation();
});
$('#game #i_list_id').on('keyup',function(event) {
var val = $.trim($(this).val()).toLowerCase();
$(this).closest('.drop-down').find('#i_list_idh').val(val);
});
$("#game #i_list_li").find("a").each(function(){
$(this).click(function(){
var text = $.trim($(this).text()).toLowerCase();
var val = $.trim($(this).attr('value'));
$(this).closest('.drop-down').find("#i_list_id").val(text);
$(this).closest('.drop-down').find('#i_list_idh').val(val);
})
});
$("#promote").on('click',function(event) {
var navlist = $(this).find('.i_list_li');
if (navlist.hasClass('hidden')) {
navlist.removeClass('hidden');
$(this).find('#i_list_id').focus().val('');
} else {
navlist.addClass('hidden');
}
$(document).one("click", function(){
navlist.addClass('hidden');
});
event.stopPropagation();
});
$('#promote #i_list_id').on('keyup',function(event) {
$(this).closest('.drop-down').find('#i_list_idh').val(-1);
});
$("#promote #i_list_li").find("a").each(function(){
$(this).click(function(){
var text = $.trim($(this).text()).toLowerCase();
$(this).closest('.drop-down').find("#i_list_id").val(text);
$(this).closest('.drop-down').find('#i_list_idh').val($(this).attr('value'));
})
});
})
</script>
</block>

@ -737,6 +737,7 @@ CREATE TABLE `tab_test_white_list` (
--
ALTER TABLE `tab_game`
ADD COLUMN `flooring_page_video_cover` int(11) NOT NULL DEFAULT 0 COMMENT '落地页视频封面';
--2019-12-11 chenzhi
ALTER TABLE `tab_game_supersign` ADD COLUMN `pay_way` tinyint(2) DEFAULT '0' COMMENT '充值方式(0:未知,1:支付宝,2:微信)' AFTER `pay_time`;
@ -863,4 +864,33 @@ DROP INDEX o ON tab_spend;
ALTER TABLE tab_spend ADD INDEX o(pay_status, is_check, settle_check, promote_id);
ALTER TABLE tab_user_login_record ADD INDEX user_id_promote_idx(user_id, promote_id);
CREATE TABLE `tab_player_retention` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`user_id` int(11) not null COMMENT '用户ID',
`game_id` int(11) NOT NULL COMMENT '游戏ID',
`player_id` int(11) NOT NULL COMMENT '玩家ID',
`day1` tinyint(1) NOT NULL default 0 COMMENT '是否1日留存',
`day2` tinyint(1) NOT NULL default 0 COMMENT '是否2日留存',
`day3` tinyint(1) NOT NULL default 0 COMMENT '是否3日留存',
`day4` tinyint(1) NOT NULL default 0 COMMENT '是否4日留存',
`day5` tinyint(1) NOT NULL default 0 COMMENT '是否5日留存',
`day6` tinyint(1) NOT NULL default 0 COMMENT '是否6日留存',
`day7` tinyint(1) NOT NULL default 0 COMMENT '是否7日留存',
`day15` tinyint(1) NOT NULL default 0 COMMENT '是否15日留存',
`day30` tinyint(1) NOT NULL default 0 COMMENT '是否30日留存',
PRIMARY KEY (`id`),
KEY `index_game_id` (`game_id`),
KEY `index_user_id` (`user_id`),
KEY `index_player_id` (`player_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='用户留存率';
-- 玩家注册时间
ALTER TABLE `tab_user_play`
ADD COLUMN `create_time` int(11) NOT NULL DEFAULT 0 COMMENT '玩家注册时间';
update tab_user_play a left join tab_user b on a.user_id= b.id set a.create_time = b.register_time where a.user_id=b.id;
ALTER TABLE `tab_spend`
ADD COLUMN `event_status` tinyint(1) NOT NULL DEFAULT 0 COMMENT '事件是否通知';
-- 菜单添加补单记录
INSERT INTO `sys_menu`(`title`, `pid`, `sort`, `url`, `hide`, `tip`, `group`, `is_dev`, `status`) VALUES ('补单记录管理', 137, 0, 'BehaviorLog/singleSupplement', 0, '', '游戏订单', 0, 1);

Loading…
Cancel
Save