Merge branch 'dev-cz' into dev_zcl

master
zhengchanglong 5 years ago
commit caf5f0aff1

@ -160,6 +160,13 @@ class GiftbagController extends ThinkController {
$model || $this->error('模型不存在!');
if(IS_POST){
if ($_POST['giftbag_version'] == '3') {
$_POST['start_time'] = time();
}
$Model = D(parse_name(get_table_name($model['id']),1));
// 获取模型的字段信息
@ -174,6 +181,11 @@ class GiftbagController extends ThinkController {
}
}
$data = $Model->create();
if ($_POST['giftbag_version'] == '3') {
$data['start_time'] = time();
}
if($data){
$data['novice'] = str_replace(array("\r\n", "\r", "\n"), ",", $_POST['novice']);
$data['novice_num'] = count(explode(',',$data['novice']));

@ -77,7 +77,7 @@
<span class="form_radio">
<gt name="key" value="0">
<label id="type0">
<input type="radio" class="inp_radio js-typeradio" value="0" name="giftbag_version" > <span class="type{$key}">全部</span>
<input type="radio" class="inp_radio js-typeradio" value="0" name="giftbag_version" > <span class="type0">全部</span>
</label>
</gt>
<volist name=":get_systems_list()" id="vo">
@ -88,7 +88,7 @@
</gt>
</volist>
<label id="type3">
<input type="radio" class="inp_radio js-typeradio" value="3" name="giftbag_version" > <span class="type{$key}">超级签</span>
<input type="radio" class="inp_radio js-typeradio" value="3" name="giftbag_version" > <span class="type3">超级签</span>
</label>
</span>

@ -76,16 +76,24 @@
<td class="l">运营平台</td>
<td class="r table_radio">
<span class="form_radio">
<label id="type0">
<input type="radio" class="inp_radio js-typeradio" value="0" name="giftbag_version" disabled="true"> <span class="type0">全部</span>
</label>
<volist name=":get_systems_list()" id="vo">
<gt name="key" value="0">
<label id="type{$key}">
<input type="radio" class="inp_radio js-typeradio" value="{$key}" name="giftbag_version" disabled="true" > <span class="type{$key}">{$vo}</span>
</label>
</gt>
</volist></span>
</volist>
<label id="type3">
<input type="radio" class="inp_radio js-typeradio" value="3" name="giftbag_version" disabled="true"> <span class="type3" >超级签</span>
</label>
</span>
<input type="hidden" id="giftbag_version" name="giftbag_version" value="{$data.giftbag_version}">
</td>
</tr>
<if condition="$data.giftbag_version neq 3">
<tr>
<td class="l">礼包状态:</td>
<td class="r table_radio">
@ -108,6 +116,8 @@
</span>
</td>
</tr>
</if>
<if condition="$data.giftbag_version neq 3">
<tr>
<td class="l">礼包类型:</td>
<td class="r table_radio">
@ -126,12 +136,14 @@
</label></span>
</td>
</tr>
</if>
<tr>
<td class="l"><i class="mustmark" style="margin-left:-7px">*</i>礼包名称:</td>
<td class="r" >
<input type="text" class="txt " name="giftbag_name" value="{$data['giftbag_name']}" placeholder=" 输入区服名称">
</td>
</tr>
<if condition="$data.giftbag_version neq 3">
<tr>
<td class="l">礼包区服:</td>
<td class="r">
@ -141,6 +153,8 @@
<input type="hidden" id="server_name" name="server_name" value=""></input>
</td>
</tr>
</if>
<if condition="$data.giftbag_version neq 3">
<tr>
<td class="l">有效周期:</td>
<td class="r table_time">
@ -148,6 +162,7 @@
<input type="text" class="txtt time" name="end_time" <if condition="$data.end_time neq ''"> value="{:set_show_time($data['end_time'],'time','other')}" </if> placeholder="输入结束时间 不填表示 永久">
</td>
</tr>
</if>
<tr>
<td class="l">激活码:</td>
<td class="r">

@ -144,7 +144,7 @@
<td ><input class="ids" type="checkbox" value="{$data['id']}" name="ids[]"></td>
<td>{$data.game_name}</td>
<td>{$data.giftbag_name}</td>
<td >{:get_systems_name($data['giftbag_version'])}</td>
<td >{:get_systems_name($data['giftbag_version'])}<if condition="$data.giftbag_version eq 3">超级签<elseif condition="$data.giftbag_version eq 0"/>全部</if></td>
<td>{$data['novice_num']}</td>
<td>{$data['novice']}</td>
<td>

@ -71,18 +71,6 @@ class SpendRepository {
return $this->assembleRecords($items, $dayList, 'count');
}
/**
* 付费游戏数
*/
public function getPayGameCountGroupByGame($params)
{
$gameIds = $params['game_ids'] ?? [];
$conditions = $this->getGameGroupConditions($params);
$field = 'game_id, count(*) count';
$items = M('spend', 'tab_')->field($field)->where($conditions)->group('game_id')->select();
return $this->assembleRecords($items, $gameIds, 'count', 'game_id');
}
/**
* 按天统计付款总额
*/
@ -124,7 +112,7 @@ class SpendRepository {
$conditions = $this->getGameGroupConditions($params);
$field = 'game_id, count(distinct user_id) count';
$items = M('spend', 'tab_')->field($field)->where($conditions)->group('game_id')->select();
return $this->assembleRecords($items, $dayList, 'count', 'game_id');
return $this->assembleRecords($items, $gameIds, 'count', 'game_id');
}
/**

@ -112,11 +112,11 @@ class UserRepository {
$params['time_column'] = 'register_time';
$conditions = $this->getGameGroupConditions($params);
$items = M('user', 'tab_')->field('count(*) count, game_id')
$items = M('user', 'tab_')->field('count(*) count, fgame_id')
->where($conditions)
->group('game_id')
->group('fgame_id')
->select();
return $this->assembleRecords($items, $gameIds, 'count', 'game_id');
return $this->assembleRecords($items, $gameIds, 'count', 'fgame_id');
}
/**

@ -67,7 +67,7 @@ class NotifyController extends BaseController
Log::write(serialize($order_info), Log::DEBUG);
if ($order_info['status']) {
$pay_where = substr($order_info['out_trade_no'], 0, 2);
Log::write("PAY_SWI:".$pay_where, Log::DEBUG);
$result = false;
switch ($pay_where) {

@ -1732,7 +1732,8 @@ class ApplyController extends BaseController
$this->ajaxReturn(['status' => 1, 'data' => $enableStatus]);
}
public function backDetailData() { //返回详情数据
public function backDetailData()
{ //返回详情数据
$result = ['code' => 10001, 'msg' => "该游戏信息不存在,请确认!", 'error' => 1, 'info' => ''];
$id = $_POST['id'];
if (empty($id)) {

@ -117,15 +117,19 @@ class HomeController extends Controller
{
$gameData = M('Game', 'tab_')
->field('relation_game_id,sdk_version')
->where(array('id' => $_GET['gid']))
->where(array('id' => intval($_GET['gid'])))
->find();
$RelationGameId = $gameData['relation_game_id'];
$gameSdkType = $gameData['sdk_version'];
$map['tab_game.relation_game_id'] = $RelationGameId;
$map['ta.promote_id'] = $_GET['pid'];
$data = M('game', 'tab_')->field('tab_game.id,tab_game.sdk_version,tab_game.icon,tab_game.screenshot,tab_game.relation_game_id,tab_game.relation_game_name,ta.enable_status,tab_game.dow_status,tab_game.features,tab_game.flooring_page_imgs')->where($map)->join('tab_apply ta ON ta.game_id = tab_game.id and ta.offline_status = 0 and ta.promote_id=' . $_GET['pid'])->select();
$data = M('game', 'tab_')
->field('tab_game.id,tab_game.sdk_version,tab_game.icon,tab_game.screenshot,tab_game.relation_game_id,tab_game.relation_game_name,ta.enable_status,tab_game.dow_status,tab_game.features,tab_game.flooring_page_imgs,ta.promote_id')
->join('tab_apply ta ON ta.game_id = tab_game.id and ta.offline_status = 0 and ta.promote_id=' . intval($_GET['pid']))
->where($map)
->group('tab_game.id')
->select();
foreach ($data as $key => $value) {
if (!empty($value['flooring_page_imgs'])) {

@ -39,8 +39,10 @@ class QueryController extends BaseController
$childPromoteIds = getAllChildPromoteList(3);
if (empty($childPromoteIds)) {
$map['tab_spend.promote_id'] = 0;
$map['tab_spend.promote_id'] = PID;
} else {
$childPromoteIds .= ',' . PID;
$map['tab_spend.promote_id'] = ['in', $childPromoteIds];
}
@ -183,8 +185,10 @@ class QueryController extends BaseController
$childPromoteIds = getAllChildPromoteList(3);
if (empty($childPromoteIds)) {
$map['tab_user.promote_id'] = 0;
$map['tab_user.promote_id'] = PID;
} else {
$childPromoteIds .= ',' . PID;
$map['tab_user.promote_id'] = ['in', $childPromoteIds];
}
@ -760,6 +764,7 @@ class QueryController extends BaseController
$time = I('time', date('Y-m-d'));
$applys = M('Apply', 'tab_')->field('game_id, game_name')->where(['promote_id' => $promote['id']])->order('game_id desc')->select();
$gameIds = array_column($applys, 'game_id');
$applys = index_by_column('game_id', $applys);
$params = [
'begin_time' => strtotime($time . ' 00:00:00'),
@ -768,10 +773,36 @@ class QueryController extends BaseController
'promote_ids' => $ids,
];
$userRepository = new UserRepository();
$spendRepository = new SpendRepository();
// $result = $spendRepository->getHistoryPayCountGroupByGame($params);
$result = $spendRepository->getPayGameCountGroupByGame($params);
var_dump($result);
$payUserCountList = $spendRepository->getPayUserCountGroupByGame($params);
$newPayUserCountList = $spendRepository->getNewPayUserCountGroupByGame($params);
$payAmountList = $spendRepository->getPayAmountGroupByGame($params);
$newPayAmountList = $spendRepository->getNewPayAmountGroupByGame($params);
$historyPayCountList = $spendRepository->getHistoryPayCountGroupByGame($params);
$loginCountList = $userRepository->getLoginCountGroupByGame($params);
$registerCountList = $userRepository->getRegisterCountGroupByGame($params);
foreach ($gameIds as $gameId) {
$records[] = [
'gameId' => $gameId,
'gameName' => $applys[$gameId]['game_name'],
'payUserCount' => $payUserCountList[$gameId],
'newPayUserCount' => $newPayUserCountList[$gameId],
'payAmount' => number_format($payAmountList[$gameId], 2),
'newPayAmount' => number_format($newPayAmountList[$gameId], 2),
'historyPayCount' => $historyPayCountList[$gameId],
'loginCount' => $loginCountList[$gameId],
'registerCount' => $registerCountList[$gameId],
'payRate' => $loginCountList[$gameId] == 0 ? '--' : round($payUserCountList[$gameId] / $loginCountList[$gameId] * 100, 2) . '%',
'ratentionOneDay' => '--',
'arpu' => $loginCountList[$gameId] == 0 ? '0.00' : number_format(round($payAmountList[$gameId] / $loginCountList[$gameId], 2), 2),
'arppu' => $payUserCountList[$gameId] == 0 ? '0.00' : number_format(round($payAmountList[$gameId] / $payUserCountList[$gameId], 2), 2),
];
}
$this->assign('records', $records);
$this->display('gameArpu');
}
public function arpu_analysis()
@ -994,10 +1025,12 @@ class QueryController extends BaseController
{
$childPromoteIds = getAllChildPromoteList(3);
if (empty($childPromoteIds)) {
$userPlayInfoWhere['tab_user_play_info.promote_id'] = 0;
$userGameLoginWhere['tab_user_game_login_record.promote_id'] = 0;
$spendWhere['tab_spend.promote_id'] = 0;
$userPlayInfoWhere['tab_user_play_info.promote_id'] = PID;
$userGameLoginWhere['tab_user_game_login_record.promote_id'] = PID;
$spendWhere['tab_spend.promote_id'] = PID;
} else {
$childPromoteIds .= ',' . PID;
$userPlayInfoWhere['tab_user_play_info.promote_id'] = ['in', $childPromoteIds];
$userGameLoginWhere['tab_user_game_login_record.promote_id'] = ['in', $childPromoteIds];
$spendWhere['tab_spend.promote_id'] = ['in', $childPromoteIds];
@ -1243,11 +1276,13 @@ class QueryController extends BaseController
$childPromoteIds = getAllChildPromoteList(3);
if (empty($childPromoteIds)) {
$map['tab_apply.promote_id'] = 0;
$userPlayInfoMap['tab_user_play_info.promote_id'] = 0;
$userGameLoginMap['tab_user_game_login_record.promote_id'] = 0;
$spendMap['tab_spend.promote_id'] = 0;
$map['tab_apply.promote_id'] = PID;
$userPlayInfoMap['tab_user_play_info.promote_id'] = PID;
$userGameLoginMap['tab_user_game_login_record.promote_id'] = PID;
$spendMap['tab_spend.promote_id'] = PID;
} else {
$childPromoteIds .= ',' . PID;
$map['tab_apply.promote_id'] = ['in', $childPromoteIds];
$userPlayInfoMap['tab_user_play_info.promote_id'] = ['in', $childPromoteIds];
$userGameLoginMap['tab_user_game_login_record.promote_id'] = ['in', $childPromoteIds];
@ -1929,7 +1964,7 @@ class QueryController extends BaseController
} else {
$spendMap['_string'] = '1<>1';
}
$allRecharges = M('spend', 'tab_')->field('count(*) count, sum(cost) cost, game_player_id')->where($gameMap)->group('game_player_id')->select();
$allRecharges = M('spend', 'tab_')->field('count(*) count, sum(cost) cost, game_player_id')->where($spendMap)->group('game_player_id')->select();
$allRecords = [];
foreach ($allRecharges as $recharge) {
$allRecords[$recharge['game_player_id']] = $recharge;

@ -200,9 +200,14 @@ class TestResourceController extends BaseController
$arrUserId = array_column($data,'id');
$logId = implode(',',$arrUserId);
if ($logId) {
$logRead = M('protect_log_read','tab_')
->where("log_id IN({$logId}) and promote_id = {$promote_id}")
->select();
}
else {
$logRead = [];
}
$upsetData = array_column($logRead,'log_id');

@ -223,7 +223,7 @@
<td>{$vo.arppu}</td>
<if condition='empty(I("game_id")) == true'>
<td>
<a onclick="chakan('{$key}')" style="cursor: pointer" class="chakan">查看</a>
<a onclick="chakan('{$vo.day}')" style="cursor: pointer" class="chakan">查看</a>
</td>
</if>
</tr>
@ -325,7 +325,7 @@ var gameId = $('#game-select').val();
function chakan(key) {
var bangbi = $('#bangbi').val();
var promote_id = $('#promote_arpu').val();
url = "/index.php?s=/Home/Query/cha_userarpu/time/"+key+"/bangbi/"+bangbi+"/promote_id/"+promote_id;
url = "/index.php?s=/Home/Query/gameArpu/time/"+key+"/bangbi/"+bangbi+"/promote_id/"+promote_id;
timetitle = key;
console.log(url);
layer.open({

@ -463,7 +463,10 @@
dataType: 'json',
success: function (data) {
var html = "<option value='' selected>推广员账号</option>";
if (promoteId > 0) {
html += "<option value='" + promoteId + "'>" + promoteValue + "</option>";
}
if (data.status == 1) {
var promoteData = data.data;

@ -0,0 +1,280 @@
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>{$meta_title}-个人中心</title>
<link href="__CSS__/20170831/iconfont.css" rel="stylesheet" type="text/css">
<link href="__CSS__/20170831/select2.min.css" rel="stylesheet" type="text/css" />
<link href="__CSS__/20170831/common.css" rel="stylesheet" type="text/css">
<link href="{:get_cover(C('CH_SET_ICO'),'path')}" type="image/x-icon" rel="shortcut icon">
<script type="text/javascript" src="__JS__/jquery-1.11.1.min.js"></script>
<!--[if lt IE 9]>
<script type="text/javascript" src="__STATIC__/jquery-1.10.2.min.js"></script>
<![endif]-->
{:hook('pageHeader')}
<script type="text/javascript" src="__STATIC__/layer/layer.js" ></script>
<block name="css"></block>
<script type="text/javascript" src="__JS__/20170831/common.js"></script>
<link href="__CSS__/20170831/data.css" rel="stylesheet">
<style type="text/css">
.keywords_information {margin-left:15px;cursor:pointer;}
.keywords_information .keywords_mark {height:35px;line-height:35px;color:#145ccd;}
.keywords_information .keywords_mark span{border-bottom:1px solid transparent;}
.keywords_information .keywords_mark:hover span {border-bottom-color:#145ccd;}
.keywords_information .keywords_content {transition:opacity 1.2s,visibility 1.5s;}
.keywords_information .keywords_content:before {margin-left:41px;}
.keywords_information .keywords_content .keywords_close {position:absolute;right:0;top:0;width:30px;height:30px;line-height:30px;color:#FFF;}
.keywords_information .keywords_list span:first-child {width:160px;}
.keywords_information .keywords_list span:last-child {width:350px;}
.keywords_information {position:relative;display:inline-block;}
.keywords_information .keywords_mark {display:block;font-size:12px;font-style:normal;font-weight:normal; }
.keywords_information .keywords_content.active {visibility:visible;opacity:1;transition:visibility 1.5s,opacity 1s;}
.keywords_information .keywords_content {visibility:hidden;opacity:0;
position:absolute;width:550px;z-index:10;background:#fff;border-radius:5px;
box-shadow:0px 4px 4px rgba(0,0,0,.1),2px 0px 2px rgba(0,0,0,.1),-2px 0px 2px rgba(0,0,0,.1);
top:38px;left:-20px;
}
.keywords_information .keywords_content:before {
display:block;content:'';
width: 0;
height: 0;
border: 10px solid transparent;
border-bottom-color: #7089A1;
margin-top: -20px;margin-left:18px;
position: absolute;top:0;left:0;
}
.keywords_information .keywords_title {
height:30px;line-height:30px;background-color:#7089A1;
border-top-left-radius:5px;border-top-right-radius:5px;color:#fff;
padding-left:10px;font-size:12px;
}
.keywords_information .keywords_list {overflow:hidden;clear:both;padding:10px;font-size:10px;padding-left:10px;border-bottom:1px solid #DBDBDD;}
.keywords_information .keywords_list:last-child {border-bottom:none;}
.keywords_information .keywords_list span {display:inline-block;display: block;
float: left;
line-height: 30px;
width: 420px;}
.keywords_information .keywords_list span:first-child {width:160px;margin-right:20px;}
.trunk-list .table .odd {background: #F0EFF5;}
.page-list .trunk-list .table tr {
height: 40px;
line-height: 40px;
color: #515974;
}
.trunk-list .table th{font-weight: 600;}
.trunk-list .table th, .trunk-list .table td{font-size: 14px;}
.page-list .trunk-list .table tr.no_data{border: none;text-align: center;}
.page-list .trunk-list .table tr.no_data img{padding-top: 28px;}
.trunk-list .table tr:nth-child(2n-1) {border-top: 1px solid #f3f5f9;border-bottom: 1px solid #f3f5f9;}
</style>
<style>
.pagenation {padding:25px 20px;text-align:center;position: relative;}
.pagenation>div {display:inline-block;text-align:center;}
.pagenation span,.pagenation a {display:inline-block;height:40px;padding:0px 20px;border:none; text-align:center;line-height:40px;color:#D7DCDF;float:left;}
.pagenation span.current,.pagenation a:hover {border-color:#526782;color:#526782;}
.pagenation .prev {border-top-left-radius:5px;border-bottom-left-radius:5px;}
.pagenation .next {border-top-right-radius:5px;border-bottom-right-radius:5px;}
.pagenation div {
float: right;
border-radius: 5px;
line-height: 1.444444;
}.pagenation span.rows {
color: #515974;position: absolute;
left: 0;
top: 30px;
border: none;
}
.pagenation select {
height: 30px;
float: left;
margin-right: 15px;
color: #404040;
border: 1px solid #ccc;
padding: 2px;
border-radius: 3px;
}
.pagenation .sch-btn, .pagenation .sch-btn:hover {
background: #3C95C8;
font-size: 14px;
font-weight: normal;
cursor: pointer;
color: #fff;
cursor: pointer;
border-radius: 3px;
text-align: center;
border-bottom: none;
width: 55px;
height: 30px;padding: 0;
float: right;
margin-left: 15px;
line-height: 30px;
border: none;
}
</style>
</head>
<body style="background:#ffffff">
<div class="trunk" style="padding:0;">
<div class="page-list query-recharge-list" style="margin-top:0px;min-height:200px;">
<div class="trunk-content article">
<div class="trunk-list">
<table class="table" id="datacontent">
<table class="table" id="datatable"><thead>
<tr class="odd">
<th>游戏名称</th>
<th>新增玩家</th>
<th>活跃玩家</th>
<th>充值金额</th>
<th>付费玩家</th>
<th>新增付费用户</th>
<th>付费率</th>
<th>ARPU</th>
<th>ARPPU</th>
</tr></thead><tbody>
<empty name="records">
<tr class="no_data"><td colspan="11"><img src="__IMG__/20180207/icon_chakan_wushujv1.png"/><p style="line-height: 20px;color: #A5A5A5;">暂无数据</p></td></tr>
<else />
<volist name="records" id="record" mod="2">
<tr name="rows" class="<eq name='mod' value='1'>odd</eq>">
<td>{$record.gameName}</td>
<td>{$record.registerCount}</td>
<td>{$record.loginCount}</td>
<td>{$record.payAmount}</td>
<td>{$record.payUserCount}</td>
<td>{$record.newPayUserCount}</td>
<td>{$record.payRate}</td>
<td>{$record.arpu}</td>
<td>{$record.arppu}</td>
</tr>
</volist>
</empty></tbody>
</table>
</table>
<div class="pagenation clearfix">
</div>
</div>
</div>
</div>
<link rel="stylesheet" type="text/css" href="__CSS__/p_jquery.datetimepicker.css">
<script type="text/javascript" src="__JS__/jquery.datetimepicker.js"></script>
<script type="text/javascript" src="__JS__/20170831/select2.min.js"></script>
<script type="text/javascript" src="__JS__/20170831/pagination.js"></script>
<script type="text/javascript" src="__JS__/20170831/string.js"></script>
<script type="text/javascript" src="__JS__/20170831/tabpage.js"></script>
<eq name='timeout' value='1'>
<script>
layer.msg('时间间隔不能超过90天');
</script>
</eq>
<script>
function chakan() {
url = "{:U('Query/cha_userarpu',array('time'=>$vo['time'],'promote_name'=>$promote_name,'promote_id'=>$_REQUEST['promote_id']))}";
timetitle ="游戏数据";
ptitle = "游戏数据";
console.log(url);
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
});
}
});
}
</script>
<script type="text/javascript">
setValue('promote_id',{$Think.request.promote_id|default=0});
setValue('game_id','{$Think.request.game_id|default=0}');
$().ready(function(){
$("#pagehtml a").on("click",function(event){
event.preventDefault();//使a自带的方法失效即无法调整到href中的URL(http://www.baidu.com)
var geturl = $(this).attr('href');
$('#data_form').attr('action',geturl);
$('#data_form').submit();
});
$('#sdate').datetimepicker({
lang:'ch',
format:'Y-m-d',
formatDate:'Y-m-d',
scrollMonth:false,
scrollTime:false,
scrollInput:false,
timepicker:false
});
$(".select_gallery").select2();
$('#edate').datetimepicker({
lang:'ch',
format:'Y-m-d',
formatDate:'Y-m-d',
scrollMonth:false,
scrollTime:false,
scrollInput:false,
timepicker:false
});
tablePage('datatable', 'datacontent', 'pagenation', [1, 2, 4, 5, 6, 10], false);
$('.keywords_information .keywords_mark').click(function() {
var that = $(this).siblings().addClass('active');
console.log(that);
$(document).click(function(event) {
var e = event || window.event;
var target= $(e.target);
if (!target.hasClass('keywords_information') && target.closest('.keywords_information').length<1) {
that.removeClass('active');
}
});
that.find('.keywords_close').click(function() {
that.removeClass('active');
return false;
});
return false;
});
$("#game_id").change(function(){
var game_name = $('#game_id option:selected').text();
$("#game_name").val(game_name);
});
$("#promote_id").change(function(){
var account = $('#promote_id option:selected').text();
$("#promote_account").val(account);
})
});
</script>
</body>
</html>

@ -186,10 +186,8 @@
<th>游戏名称</th>
<th>区服</th>
<th>角色名</th>
<empty name="ownId">
<th>组长</th>
<th>推广员</th>
</empty>
<th>付款时间</th>
<th>操作</th>
</tr>
@ -210,7 +208,6 @@
<td>{$vo.game_name}</td>
<td>{$vo.server_name}</td>
<td>{$vo.game_player_name}</td>
<empty name="ownId">
<empty name="vo.pro_grand_id">
<td>{$vo.pro_account}({$vo.pro_real_name})</td>
<td>{$vo.pro_account}({$vo.pro_real_name})</td>
@ -218,7 +215,6 @@
<td>{$vo.p_pro_account}({$vo.p_pro_real_name})</td>
<td>{$vo.pro_account}({$vo.pro_real_name})</td>
</empty>
</empty>
<td>{$vo.pay_time|date='Y-m-d H:i:s',###}</td>
<td>
<a href="{:U('Query/viewSpendDetailed',array('id'=>$vo['id']))}" style="cursor: pointer"
@ -289,7 +285,10 @@
dataType: 'json',
success: function (data) {
var html = "<option value='' selected>推广员账号</option>";
if (promoteId > 0) {
html += "<option value='" + promoteId + "'>" + promoteValue + "</option>";
}
if (data.status == 1) {
var promoteData = data.data;

@ -194,7 +194,10 @@
dataType: 'json',
success: function (data) {
var html = "<option value='' selected>推广员账号</option>";
if (promoteId > 0) {
html += "<option value='" + promoteId + "'>" + promoteValue + "</option>";
}
if (data.status == 1) {
var promoteData = data.data;

@ -250,7 +250,10 @@
dataType: 'json',
success: function (data) {
var html = "<option value='' selected>推广员账号</option>";
if (promoteId > 0) {
html += "<option value='" + promoteId + "'>" + promoteValue + "</option>";
}
if (data.status == 1) {
var promoteData = data.data;

@ -129,7 +129,6 @@
</div>
</div>
</div>
<div class="head">
<div class="m1200">
<a href="{:U('Index/index')}" class="logo">
@ -170,10 +169,11 @@
<li>
<a class="khd" target="_blank" href="{:U('Index/download')}" ><span>{:C('PC_NAVIGATION_CLIENT')?C('PC_NAVIGATION_CLIENT'):'客户端'}</span><i></i></a>
</li>
</if>
<!-- </if>-->
</ul>
</div>
</div>
<!-- 主体内容 -->
<block name="body"></block>
@ -254,8 +254,6 @@
</div>
</div>-->
</div>
</div>
<block name="giftextend"></block>
<script>

@ -399,4 +399,23 @@ class SsgController extends BaseController {
}
}
/**
* 领取激活码
* @param $token
* @param $gift_id
* author: xmy 280564871@qq.com
*/
public function get_novice($user_id,$gift_id){
$model = D("Giftbag");
$exist = $model->checkAccountGiftExist($logininfo['user_id'],$gift_id);
if($exist){
$this->error("您已经领取过该礼包!");
}
$novice = $model->getNovice($logininfo['user_id'],$logininfo['account'],$gift_id);
if(empty($novice)){
$this->error("暂无激活码");
}
$this->success("领取成功",$novice);
}
}

@ -115,7 +115,7 @@
<div class="banner" style="width:100%;">
<div class="swiper-container swiper-container-banner" style="width:100%;">
<div class="swiper-wrapper">
<volist name="wap_index" id="cr" offset="3" length='3'>
<volist name="wap_index" id="cr" >
<div class="swiper-slide">
<a href="{$cr.url}" target="{$cr.target}" class="swiper-slide_a">

@ -87,10 +87,10 @@
}
</style>
<div class="foot-nav-list">
<!-- <a href="{:U('Index/index')}" class="<if condition='CONTROLLER_NAME eq Index' >on</if>">
<a href="{:U('Index/index')}" class="<if condition='CONTROLLER_NAME eq Index' >on</if>">
<i class="iconfont icon-home"></i>
<p>首页</p>
</a> -->
</a>
<if condition="C('IS_OPEN_SMALL_ACCOUNT') neq 0">
<a href="{:U('Trade/index')}" class="<if condition='CONTROLLER_NAME eq Trade'>on</if>">
<i class="iconfont icon-trade"></i>
@ -113,20 +113,20 @@
<i class="iconfont icon-shop"></i>
<p>商城</p>
</a>-->
<!-- <a href="{:U('Index/product')}" class="<if condition='CONTROLLER_NAME eq Gift'>on</if>">
<a href="{:U('Index/product')}" class="<if condition='CONTROLLER_NAME eq Gift'>on</if>">
<i class="iconfont icon-gift"></i>
<p>产品服务</p>
</a>
<a href="{:U('Index/business')}" class="<if condition='CONTROLLER_NAME eq Shop'>on</if>">
<i class="iconfont icon-shop"></i>
<p>商务合作</p>
</a> -->
</a>
<!--<a href="{:U('News/index')}" class="<if condition='CONTROLLER_NAME eq News'>on</if>">
<i class="iconfont icon-news"></i>
<p>资讯</p>
</a>-->
</if>
<a style="width: 100%; margin-left: 0px;" href="{:U('User/index')}" class="<if condition='CONTROLLER_NAME eq User'>on</if>">
<a href="{:U('User/index')}" class="<if condition='CONTROLLER_NAME eq User'>on</if>">
<i class="iconfont icon-user"></i>
<p>我的</p>
</a>
@ -157,7 +157,13 @@
<div class="kf_pic">
<a href="tencent://message/?uin={:C('PC_SET_SERVER_QQ')}&amp;menu=yes" id="launch_qq "><span><img src="__IMG__/qq_icon.png "></span><b>在线客服</b></a>
<i class="arrow "></i>
</div>
</li>
<li class="show kf " >
<a href="./media.php"></a>
<div class="kf_pic">
<a href="./media.php" target="_blank"><span><img src="__IMG__/pc_icon.png "></span><b>pc官网</b></a>
<i class="arrow "></i>
</div>
</li>
@ -177,7 +183,7 @@
<i class="arrow "></i>
</div>
</li>
<li class="show pop ">
<!-- <li class="show pop ">
<a href="./index.php" target="_blank"></a>
<div class="pop_pic">
推广游戏得分成~<br>
@ -186,21 +192,13 @@
<i class="arrow "></i>
</div>
</li>
<li class="show kf " >
<a href="./media.php"></a>
<div class="kf_pic">
<a href="./media.php" target="_blank"><span><img src="__IMG__/pc_icon.png "></span><b>pc官网</b></a>
<i class="arrow "></i>
</li> -->
</div>
</li>
<li class="show kf " >
<a href="https://www..com/"></a>
<a href="javascript:alert('暂无')"></a>
<div class="kf_pic">
<a href="https://www..com/" target="_blank"><span><img src="__IMG__/pc_icon.png "></span><b>技术支持</b></a>
<a href="javascript:alert('暂无')"><span><img src="__IMG__/pc_icon.png "></span><b>技术支持</b></a>
<i class="arrow "></i>
</div>
</li>
<li>

@ -238,7 +238,7 @@ var index = {
}
index.getgamelist();
$(".pay-button").on("click",function(){
var inres = index.pay_game_id.indexOf(index.choose.game_id);
var inres = index.pay_game_id.indexOf(index.choose.game_id+'');
if(inres > -1){
alert("亲~您已购买过了~请到【订单查询】查看订单信息哟~");
}else{

@ -133,12 +133,12 @@
</a>
</li>
</if>
<li>
<!-- <li>
<?php $useing_record = $user['id'] ? U('useing_record') : U('login');?>
<a class="item" href="{$useing_record}">
<img src="__IMG__/icon_xiaofei@3x.png" class="icon"><p class="name">消费记录</p>
</a>
</li>
</li> -->
<!-- 最后一个空矩形框,无内容 begin! -->
<li>
<a class="item" >

@ -9,6 +9,7 @@ use Org\GoldPig\GoldPig;
use Org\SqpaySDK\Sqpay;
use Org\HeepaySDK\Heepay;
use Qiniu\json_decode;
use Think\Log;
class AppleController extends BaseController{
@ -88,14 +89,16 @@ class AppleController extends BaseController{
*/
public function apple_alipay_pay($user_id,$game_id){
#获取SDK上POST方式传过来的数据 然后base64解密 然后将json字符串转化成数组
//echo json_encode(['code'=>0,'msg'=> $user_id."game:".$game_id]);exit;
$file=file_get_contents("./Application/Sdk/OrderNo/".$user_id."-".$game_id.".txt");
$request = json_decode(think_decrypt($file),true);
C(api('Config/lists'));
/*$request['user_id'] = 1;
/*
$request['user_id'] = 1;
$request['game_id'] = 1;
$request['price'] = 1.01;
$request['extend'] = 21111183;
$request['extend'] = 21111184;
$request['pay_order_number'] = 21111183;
$request['sdk_version'] = 2;
$request['code'] =1;
@ -324,7 +327,8 @@ class AppleController extends BaseController{
->setGameId($param['game_id'])
->setGameName(get_game_name($param['game_id']))
->setGameAppid($param['game_appid'])
->setServerId(0)
->setServerId($param['server_id'])
->setGameplayerId($param['game_player_id'])
->setCallback($param['callback'])
->setNotifyUrl($param['notifyurl'])
->setGameplayerName($param['game_player_name'])
@ -354,6 +358,7 @@ class AppleController extends BaseController{
{
$file=file_get_contents("./Application/Sdk/OrderNo/".$user_id."-".$game_id.".txt");
$request = json_decode(think_decrypt($file),true);
// Log::write("wxpay:".serialize($request));
/*$request['user_id'] = 1;
$request['game_id'] = 1;
$request['price'] = 157.01;

@ -73,10 +73,7 @@ class ExchangeController extends BaseController{
$request['spend_ip'] = get_client_ip();
file_put_contents("./Application/Sdk/OrderNo/".$request['user_id']."-".$request['game_id'].".txt",think_encrypt(json_encode($request)));
echo base64_encode(json_encode(array('status'=>200,'out_trade_no'=>$out_trade_no,'img'=>'http://' . $_SERVER ['HTTP_HOST'].'/sdk.php?s=/Spend/pay_way&user_id='.$request['user_id'].'&game_id='.$request['game_id'].'&type=1')));exit;
} else {
@ -106,8 +103,11 @@ class ExchangeController extends BaseController{
file_put_contents("./Application/Sdk/OrderNo/".$request['user_id']."-".$request['game_id'].".txt",think_encrypt(json_encode($request)));
echo base64_encode(json_encode(array('status'=>200,'out_trade_no'=>$out_trade_no,'img'=>'http://' . $_SERVER ['HTTP_HOST'].'/sdk.php?s=/Spend/pay_way&user_id='.$request['user_id'].'&game_id='.$request['game_id'].'&type=1')));exit;
<<<<<<< HEAD
=======
>>>>>>> 02043044b5ad23725e95e03440fc41595e79047f
}elseif(!get_game_appstatus2($request['game_id'])&&$request['is_create_ordernumer']==1){ /* 苹果支付 */

@ -7,7 +7,7 @@ use Mobile\Controller\SsgController;
// a8eeac3335cef5ee117d357738598f691932513b
class Ipa365Controller extends BaseController{
const signprice = 10; // 超级签价格
const signprice = 0.01; // 超级签价格
public $userinfo;
public function __construct() {
@ -118,16 +118,23 @@ class Ipa365Controller extends BaseController{
$payLog = M('game_supersign', 'tab_')->where(array(
'user_id' => $userId,
'game_id' => $gameId,
'pay_status' => 0
'game_id' => $gameId
))->find();
$gameInfo = M('game', 'tab_')->field('game_name,supersign_token')->where(array(
'id' => $gameId,
))->find();
if ($payLog) {
if ($payLog && $payLog['pay_status']==0) {
$orderId = $payLog['order_id'];
}elseif ($payLog && $payLog['pay_status']==1){
$orderId = $payLog['order_id'];
if(stripos($_SERVER['HTTP_HOST'], '.wmtxkj.cn') || $_SERVER['HTTP_HOST']=='127.0.0.1' || stripos($_SERVER['HTTP_HOST'], '.free.idcfengye.com')){
redirect("http://".$_SERVER['HTTP_HOST']."/sdk.php/Ipa365/install_show/user_id/$userId/game_id/$gameId/order_id/$orderId");
}else{
redirect("https://".$_SERVER['HTTP_HOST']."/sdk.php/Ipa365/install_show/user_id/$userId/game_id/$gameId/order_id/$orderId");
}
$this->error("亲~您已购买过了~请到【订单查询】查看订单信息哟~");
} else {
$orderId = "SS_" . date('Ymd') . date('His') . sp_random_string(4); // 超级签
if (!$gameInfo['supersign_token']) {
@ -162,9 +169,14 @@ class Ipa365Controller extends BaseController{
$param['body'] = $price;
//$param['callback'] = "https://m.wmtxkj.com/sdk.php/Ipa365/install_show/user_id/{$userId}/game_id/{$gameId}/order_id/{$orderId}";
//$param['notifyurl'] = "https://m.wmtxkj.com/callback.php/Notify/notify/apitype/alipay";
if(stripos($_SERVER['HTTP_HOST'], '.wmtxkj.cn') || $_SERVER['HTTP_HOST']=='127.0.0.1' || stripos($_SERVER['HTTP_HOST'], '.free.idcfengye.com')){
$param['callback'] = "http://".$_SERVER['HTTP_HOST']."/sdk.php/Ipa365/install_show/user_id/{$userId}/game_id/{$gameId}/order_id/{$orderId}";
$param['notifyurl'] = "http://".$_SERVER['HTTP_HOST']."/callback.php/Notify/notify/apitype/alipay";
}else{
$param['callback'] = "https://".$_SERVER['HTTP_HOST']."/sdk.php/Ipa365/install_show/user_id/{$userId}/game_id/{$gameId}/order_id/{$orderId}";
$param['notifyurl'] = "https://".$_SERVER['HTTP_HOST']."/callback.php/Notify/notify/apitype/alipay";
}
$ret = $this->alipay($param);
$this->assign("url", $ret['url']);
@ -279,8 +291,22 @@ class Ipa365Controller extends BaseController{
$giftbag = M('giftbag', 'tab_')->field("*")->where(array("game_id"=>$gameId,"giftbag_version"=>3))->find();
if(empty($giftbag)){
$giftbag = false;
}else{
$desribe = $giftbag['desribe'];
$mygif = $this->checkAccountGiftExist($userId,$giftbag['id']);
if(!empty($mygif)){
//已经领取
$giftbag =$mygif;
}else{
if($giftbag['novice_num']>0){
//领取
$giftbag = $this->getNovice($userId,$this->userinfo['account'],$giftbag['id']);
}
}
$giftbag['desribe'] = $desribe;
}
//验证是否领取
$this->assign('giftbag', $giftbag);
$this->display();
}
@ -418,4 +444,49 @@ class Ipa365Controller extends BaseController{
return $pay_;
}
//领取礼包码
public function getNovice($user_id,$account,$gift_id){
$data =M("giftbag",'tab_')->find($gift_id);
$novice_str = $data['novice'];
$novice_arr = str2arr($novice_str,",");
if (empty($novice_arr)){
return "";
}
$novice_arr = array_filter($novice_arr);
$novice = array_pop($novice_arr);
$data['novice_num'] = count($novice_arr);
$data['novice'] = arr2str($novice_arr,",");
M("giftbag",'tab_')->startTrans();
$novice_result = M("giftbag",'tab_')->save($data);
if(!empty($novice)){
//记录领取
$record['game_id'] = $data['game_id'];
$record['game_name'] = $data['game_name'];//get_game_name($data['game_id']);
$record['gift_id'] = $gift_id;
$record['gift_name'] = $data['giftbag_name'];
$record['status'] = 0;
$record['novice'] = $novice;
$record['user_id'] = $user_id;
$record['user_account'] = $account;
$record['create_time'] = time();
$record['start_time'] = $data['start_time'];
$record['end_time'] = $data['end_time'];
$record_result = M("gift_record",'tab_')->add($record);
}else{
$novice_result = false;
}
if($novice_result === false || $record_result === false){
M("giftbag",'tab_')->rollback();
return "";
}else{
M("giftbag",'tab_')->commit();
return $record;
}
}
public function checkAccountGiftExist($user_id,$gift_id){
$map['user_id'] = $user_id;
$map['gift_id'] = $gift_id;
return M("gift_record",'tab_')->field('*')->where($map)->find();
}
}

@ -1168,10 +1168,11 @@ class UserController extends BaseController
$user = M('user', 'tab_');
$user_data = $user -> find($user_id);
$gameName = get_game_name($request['game_id']);
$data['promote_id'] = $request['promote_id'];
$data['promote_account'] = get_promote_account($request['promote_id']);
$data['game_id'] = $request['game_id'];
$data['game_name'] = get_game_name($request['game_id']);
$data['game_name'] = $gameName;
$data['server_id'] = $request['server_id'];
$data['server_name'] = $request['server_name'];
$data['role_name'] = $request['game_player_name'];
@ -1191,9 +1192,29 @@ class UserController extends BaseController
$user_play->save($data);
$this->updateLoginRecord($data);
} else {
$data['create_time'] = time();
$data['create_ip'] = get_client_ip();
// $data['create_device_number'] = time();
$user_play->add($data);
$this->updateLoginRecord($data);
}
$server = M('server', 'tab_')->where(['server_id' => $request['server_id'], 'game_id' => $request['game_id']])->find();
if (empty($server)) {
$serverData = [
'game_id' => $request['game_id'],
'game_name' => $gameName,
'server_name' => $request['server_name'],
'server_num' => $request['server_id'],
'server_id' => $request['server_id'],
'server_version' => $request["sdk_version"],
'create_time' => time(),
'start_time' => time(),
];
M('server', 'tab_')->data($serverData)->add();
}
$this -> set_message(200, "success", "成功");
}

@ -41,7 +41,8 @@ class WapPayController extends BaseController{
->setGameId($param['game_id'])
->setGameName(get_game_name($param['game_id']))
->setGameAppid($param['game_appid'])
->setServerId(0)
->setServerId($param['server_id'])
->setGamePlayerId($param['game_player_id'])
->setGameplayerName($param['game_player_name'])
->setServerName($param['server_name'])
->setUserId($param['user_id'])
@ -623,19 +624,18 @@ class WapPayController extends BaseController{
$json_data['paytype'] ="wx";
}else{
if(!empty($request['scheme'])) {
$redirect_url = (is_ssl()?'https://':'http://'). $_SERVER ['HTTP_HOST'] . "/sdk.php/Spend/pay_success2/orderno/".$request['pay_order_number'].'/game_id/'.$request['game_id'];
$redirect_url = 'https://api.wmtxkj.com' . "/sdk.php/Spend/pay_success2/orderno/".$request['pay_order_number'].'/game_id/'.$request['game_id'];
} else {
$redirect_url = (is_ssl()?'https://':'http://'). $_SERVER ['HTTP_HOST'] . "/sdk.php/Spend/pay_success/orderno/".$request['pay_order_number'];
$redirect_url = 'https://api.wmtxkj.com' . "/sdk.php/Spend/pay_success/orderno/".$request['pay_order_number'];
}
$json_data['url'] = $is_pay['mweb_url'].'&redirect_url='.urlencode( $redirect_url );
$json_data['paytype'] ="wx";
}
}else{
$json_data['status'] = 500;
$json_data['url'] = "http://" . $_SERVER['HTTP_HOST'];
$json_data['url'] = "https://" . 'api.wmtxkj.com';
}
$json_data['cal_url'] = C("pay_header");
$json_data['cal_url'] = 'https://api.wmtxkj.com';
echo base64_encode(json_encode($json_data));exit;
// $this->redirect('WapPay/weixin_pay_view',['user_id'=>$request['user_id'],'game_id'=>$request['game_id']]);
} else if(get_wx_pay_type() == 1){ // 威富通

@ -136,7 +136,7 @@ p,input{
<ul>
<li >
<div class="gift-title">
<h2>{$giftbag['giftbag_name']}</h2>
<h2>{$giftbag['gift_name']}</h2>
</div>
<p class="gift-info">{$giftbag['desribe']}</p>
<p class="gift-code">

@ -158,6 +158,9 @@ CREATE TABLE `tab_protect_log_read` (
`create_time` int(11) DEFAULT '0' COMMENT '创建时间',
PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=25 DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC;
-- 增加用户Token 验证用户
ALTER TABLE `tab_user`
ADD COLUMN `user_token` char(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '用户token 登入时下发' AFTER `token`;
-- ----------------------------
-- 2019-10-17 zyx

@ -436,8 +436,8 @@
}
.float_contact1 .float-bg {
width: 50px;
height:342px;
background: url(../images/float_contact1.png);
height: 230px;
background: url(../images/float_contact2.png);
position: absolute;
top: 0;
left: 0;
@ -446,17 +446,17 @@
.float_contact1 ul {
width: 52px;
height: 171px;
padding-top: 14px;
padding-top: 13px;
}
.float_contact1 ul li {
float: left;
width: 100%;
margin-bottom: 11px;
margin-bottom: 14px;
position: relative;
}
.float_contact1 ul li a {
width: 100%;
height: 39px;
height: 32px;
display: inline-block;
float: left;
position: relative;

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.4 KiB

@ -313,6 +313,7 @@ class Pay
$spend_data['game_name'] = $vo->getGameName();
$spend_data['server_id'] = $vo->getServerId();
$spend_data['server_name'] = $vo->getServerName();
$spend_data['game_player_id'] = $vo->getGameplayerId();
$spend_data['game_player_name'] = $vo->getGameplayerName();
$spend_data['promote_id'] = $vo->getPromoteId();
$spend_data['promote_account'] = $vo->getPromoteName();

@ -24,6 +24,7 @@ class PayVo {
protected $_serverid;
protected $_serverName;
protected $_gameplayerName;
protected $_gameplayerId;
protected $_userid;
protected $_account;
protected $_userNickName;
@ -60,6 +61,12 @@ class PayVo {
return $this;
}
// 设置游戏玩家ID
public function setGameplayerId($gameplayerId) {
$this->_gameplayerId = $gameplayerId;
return $this;
}
//退款批次号
public function setBatchNo($batchno) {
$this->_batchno = $batchno;
@ -446,6 +453,14 @@ class PayVo {
return $this->_gameid;
}
/**
* 获取角色id
* @return type
*/
public function getGameplayerId() {
return $this->_gameplayerId;
}
/**
* 获取游戏名称
* @return type

Loading…
Cancel
Save