Merge branch 'feature/promote' of 47.111.118.107:/srv/git/platform into feature/promote

master
jbrazz 5 years ago
commit 0dcb2a2014

2
.gitignore vendored

@ -7,4 +7,4 @@ Application/Sdk/OrderNo/
.idea/
Uploads/
.vscode
vendor/
vendor/

@ -543,6 +543,18 @@ function getPartnerName($id = 0)
return M('Partner', 'tab_')->where(array('id' => intval($id)))->getField('partner');
}
function getGameByName($game_name=null, $sdk_version=null)
{
$map = [];
if ($game_name) {
$map['relation_game_name'] = $game_name;
}
if ($sdk_version) {
$map['server_version'] = $sdk_version;
}
return D("Game")->where($map)->select();
}
function getTopPromote($promote_id)
{
$promoter = M('promote', 'tab_')->where(['id' => $promote_id])->find();
@ -556,4 +568,4 @@ function getTopPromote($promote_id)
$topPromoteId = explode('/', $chain)[0];
return M('promote', 'tab_')->where(['id' => $topPromoteId])->find();
}
}
}

@ -34,7 +34,11 @@ class AjaxController extends ThinkController{
* @param $game_id
*/
public function getServer($game_id=""){
$data = M('server','tab_')->where(['game_id'=>$game_id])->select();
$map = [];
if (!empty($game_id)) {
$map['game_id'] = $game_id;
}
$data = M('server','tab_')->where($map)->select();
$this->AjaxReturn($data);
}
@ -42,7 +46,7 @@ class AjaxController extends ThinkController{
*获取充值游戏区服
* @param game_id
*/
public function getSpendServer($game_id="",$type=1){
public function getSpendServer($game_id="",$type=1, $game_type='', $game_name=''){
if($type==2){
$game = M('Game','tab_')->field('id')->where(['game_name'=>$game_id])->find();
$game_id = $game['id'];
@ -66,7 +70,26 @@ class AjaxController extends ThinkController{
$map['server_name'] = array('neq','');
$data = M('UserPlayInfo','tab_')->field('server_name')->where($map)->group('server_name')->select();
$this->AjaxReturn($data);
}
public function getGmeServer($game_name="", $sdk_version="")
{
$game_map = [];
if ($game_name) {
$game_map['relation_game_name'] = $game_name;
}
if ($sdk_version) {
$map['server_version'] = $game_map['sdk_version'] = $sdk_version;
}
$game = M("Game", 'tab_')->where($game_map)->getField('id', true);
// 获取版本信息
$map = [];
if ($game) {
$map['game_id'] = ['in', $game];
}
$data = M('Server', 'tab_')->field('id, server_name, server_id')->where($map)->select();
$this->AjaxReturn($data);
}
/**
@ -132,4 +155,41 @@ class AjaxController extends ThinkController{
{
$this->ajaxReturn(['code'=>1, 'msg'=>'获取成功', 'data'=>(new PromoteModel)->getPromotersByLevel($level)]);
}
public function getGameList($type=0, $sdk_type=0)
{
$game = M("game","tab_");
if(MODULE_NAME == 'Admin') {
$map['game_status'] = array('in','0,1');
} else {
$map['game_status'] = 1;
}
if(!empty($type)){
/*$map['developers'] = $type == 1? array('EQ',0):array('GT',0);*/
/* $map['game_status'] = $type == 1? 1:array('in','0,1'); */
switch($type) {
case 1:
$map['developers'] = array('EQ',0);
break;
case 2:
$map['developers'] = array('EGT',0);
break;
default:
$map['developers'] = array('GT',0);
}
}else{
$map['apply_status'] = 1;
$map['online_status'] = 1;
}
if (empty($sdk_type)) {
$lists = $game->field('id,game_name,sdk_version,relation_game_name,icon,relation_game_id,game_status,display_site,dow_num')->where($map)->group('relation_game_name')->order("id asc")->select();
} else {
$map['sdk_version'] = $sdk_type;
$lists = $game->field('id,game_name,sdk_version,relation_game_name,icon,relation_game_id,game_status,display_site,dow_num')->where($map)->order("id asc")->select();
}
$this->ajaxReturn(['code'=>1, 'msg'=>'获取成功', 'data'=>$lists]);
}
}

@ -13,7 +13,6 @@ class MemberController extends ThinkController
*/
public function user_info($p = 0)
{
$hav = '';
if ($_REQUEST['promote_id'] != '') {
if($_REQUEST['promote_id']=='UC'){
@ -109,6 +108,19 @@ class MemberController extends ThinkController
$map['lock_status'] = $_REQUEST['status'];
unset($_REQUEST['status']);
}
$game_map = "";
// if (isset($_REQUEST['game_type'])) {
// $game_map .= " and tab_user_play.sdk_version = {$_REQUEST['game_type']}";
// }
if (isset($_REQUEST['game_name'])) {
$game_map .= " and tab_user_play.game_id in (".implode(',', array_column(getGameByName($_REQUEST['game_name'], $_REQUEST['game_type']), 'id')).")";
}
$game_play_map = '';
if (isset($_REQUEST['server_name'])) {
$game_play_map .= " and tab_user_play_info.server_name = '{$_REQUEST['server_name']}' ";
}
if (isset($_REQUEST['viplevel'])) {
@ -164,26 +176,28 @@ class MemberController extends ThinkController
$data = $usermodel->table('('.$sql1.') as a ')->field('a.id,a.device_number,a.age_status,a.account,a.balance,a.gold_coin,a.alipay,a.promote_id,a.register_type,a.promote_account,a.register_time,a.lock_status,a.register_way,a.register_type,a.register_ip,a.login_time,(a.deposit_total+IFNULL(sum(ss.pay_amount),0)) as recharge_total,check_status')
->join('left join tab_spend as ss on ss.user_id=a.id AND ss.pay_status = 1')
->join(isset($_REQUEST['game_id']) ? "tab_user_play as up on up.user_id = a.id and up.game_id = {$_REQUEST['game_id']} " : false)
->join($game_map ? "tab_user_play on tab_user_play.user_id = a.id $game_map" : false)
->join($game_play_map ? "tab_user_play_info on tab_user_play_info.user_id = a.id $game_play_map" : false)
->page($page, $row)
->having($havs)
->group('a.id')
->order($order)
->select();
// var_dump($data);die;
//var_dump($usermodel->getLastSql());die;
//计数
$sql = M('user', 'tab_')->field('tab_user.id,(IFNULL(sum(b.pay_amount),0) + IFNULL(sum(ss.pay_amount),0)) AS recharge_total')
->join('left join tab_deposit AS b ON tab_user.id = b.user_id AND b.pay_status = 1')
->join('left join tab_spend as ss on ss.user_id=tab_user.id AND ss.pay_status = 1')
->join(isset($_REQUEST['game_id']) ? "tab_user_play as up on up.user_id = tab_user.id and up.game_id = {$_REQUEST['game_id']} " : false)
->join($game_map ? "tab_user_play on tab_user_play.user_id = tab_user.id $game_map" : false)
->join($game_play_map ? "tab_user_play_info on tab_user_play_info.user_id = tab_user.id $game_play_map" : false)
->where($map)
->group('tab_user.id')
->where($hav)
->having($havs)->select(false);
// var_dump($sql);die;
$jcount = M('User','tab_')->field('count(a.id) as count')->table('('.$sql.') as a')->select();
$jcount = M('User','tab_')->field('count(a.id) as count')->table('('.$sql.') as a')->select();
$count = $jcount[0]['count'];
$model = M('Model')->getByName('user');
@ -336,7 +350,18 @@ class MemberController extends ThinkController
$this->display();
}
}
public function role_list($p=1, $user_id='', $row=10)
{
$limit = ($p-1)*$row . ", $row";
$list = M("user_play_info", 'tab_')->where(['user_id'=>$user_id])->limit($limit)->order('play_time desc')->select();
$count = M("user_play_info", 'tab_')->where(['user_id'=>$user_id])->count();
$page = set_pagination($count,$row);
if($page) {$this->assign('_page', $page);}
$this->assign('list', $list);
$this->display();
}
/**
* 公用账户
@ -640,9 +665,13 @@ class MemberController extends ThinkController
public function login_record($p = 1)
{
if (isset($_REQUEST['game_name'])) {
$extend['game_name'] = $_REQUEST['game_name'];
$map['game_name'] = ['like', $_REQUEST['game_name']."%"];
unset($_REQUEST['game_name']);
}
if (isset($_REQUEST['game_type'])) {
$map['sdk_version'] = $_REQUEST['game_type'];
unset($_REQUEST['game_type']);
}
if (isset($_REQUEST['login_ip'])) {
$map['login_ip'] = $_REQUEST['login_ip'];
unset($_REQUEST['login_ip']);
@ -667,6 +696,10 @@ class MemberController extends ThinkController
$map['user_account'] = array('like', '%' . trim($_REQUEST['account']) . '%');
unset($_REQUEST['account']);
}
if (isset($_REQUEST['server_name'])) {
$map['server_name'] = $_REQUEST['server_name'];
unset($_REQUEST['server_name']);
}
// $map['type'] = 1;
$map['login_time'] = array('neq', 0);
$extend = array();
@ -717,7 +750,7 @@ class MemberController extends ThinkController
*/
public function lock_status($id, $lock_status)
{
$map['id'] = $id;
$map['id'] = ['in', explode(',', $id)];
$res = M('user', 'tab_')->where($map)->setField(['lock_status' => $lock_status]);
if ($res) {
\Think\Log::actionLog('Member/lock_status','Member',$id);
@ -1082,4 +1115,46 @@ class MemberController extends ThinkController
}
}
public function device_bans_list($row=10, $type='', $tag='', $p=1)
{
$map = [];
if (!empty($type)) {
$map['type'] = $type;
}
if (!empty($tag)) {
$map['tag'] = $tag;
}
$list = M('device_bans', 'tab_')->where($map)->page($p, $row)->select();
$count = M('device_bans', 'tab_')->where($map)->count();
$page = set_pagination($count,$row);
if($page) {$this->assign('_page', $page);}
$this->assign('list_data', $list);
$this->display();
}
public function save_device_bans($id='', $type='', $tag='')
{
if (empty($id)) {
if (IS_GET) {
return $this->display('device_bans_edit');
} else {
$map = [];
if (empty($type) || empty($tag)) {
return $this->error("请填写完整信息");
}
$map['type'] = $type;
$map['tag'] = $tag;
$item = M('device_bans', 'tab_')->where($map)->find();
if ($item) {
return $this->error("该禁用已经存在(ID{$item['id']})");
}
M('device_bans', 'tab_')->add(['type'=>$type, 'tag'=>$tag, 'create_time'=>time(), 'operator_id'=>is_login()]);
}
return $this->success("新增成功");
} else {
M('device_bans', 'tab_')->where(['id'=>$id])->delete();
return $this->success("解除成功");
}
}
}

@ -58,9 +58,9 @@ class MendController extends ThinkController {
public function edit($id = null)
{
// $promoteService = new PromoteService();
if (IS_POST) {
$promoteService = new PromoteService();
if ($_POST['prmoote_id_to'] == -1){
$_POST['prmoote_id_to'] = 0;
}
@ -70,44 +70,27 @@ class MendController extends ThinkController {
if ($_POST['promote_id'] == $_POST['prmoote_id_to']) {
$this->error('没有变更数据');
}
if ($_POST['order_time'] == '') {
$this->error('没有订单日期');
}
$create = $_REQUEST;
dump($create);
$map['id'] = $create['user_id'];
$map_['user_id'] = $create['user_id'];
$data['promote_id'] = $create['prmoote_id_to'];
$data['promote_account'] = get_promote_name($create['prmoote_id_to']);
// 加入补链时间
$data['rebind_time'] = $create['rebind_time'];
dump($data);
$user_data = $data;
$promote = M('promote', 'tab_')->where(array("id"=>I('prmoote_id_to')))->find();
if ($promote['parent_id'] != "0") {
$ppromote = M('promote', 'tab_')->where(array("id"=>$promote['parent_id']))->find();
$user_data['parent_id']=$ppromote['id'];
$create['order_time'] = date($create['order_time']);
$params = array(
"from_promote_id"=>$create['promote_id'],
"to_promote_id"=>$create['prmoote_id_to'],
"order_time"=>$create['order_time'],
"type"=>2,
"shift_ids"=>[$create['user_id']],
);
if(!empty($create['remark'])){
$params['remark'] = $create['remark'];
}
$res = $promoteService->addShiftTask($params);
if($res['status']){
$this->success('补链成功', U('lists'), 2);
}else{
$user_data['parent_id'] = 0;
$this->error($res['msg']);
}
$user_data['parent_name']=get_promote_name($user_data['parent_id']);
// $user = M('user', 'tab_')->where($map)->save($user_data);
// $user_ = M('UserPlay', 'tab_')->where($map_)->save($data);
// $puser_ = M('UserPlayInfo', 'tab_')->where($map_)->save($data);
// $spend = M('Spend', 'tab_')->where($map_)->where(array('is_check'=>array('in','1,2')))->save($data);// spend只改未对账的数据
// $depost = M('Deposit', 'tab_')->where($map_)->save($data);
// $Bind_spend = M('Bind_spend', 'tab_')->where($map_)->save($data);
// $create['user_account'] = get_user_account($create['user_id']);
// $create['promote_account'] = get_promote_name($create['promote_id']);
// $create['promote_id_to'] = $create['prmoote_id_to'];
// $create['promote_account_to'] = get_promote_name($create['prmoote_id_to']);
// $create['create_time'] = time();
// $create['op_id'] = UID;
// $create['op_account'] = session('user_auth.username');
// $create['bind_type'] = $create['bind_type'];
// $mend = M('mend', 'tab_')->add($create);
// if ($mend) {
// $this->success('补链成功', U('lists'), 2);
// }
} else {
$user = A('User', 'Event');
$user_data = $user->user_entity($id);
@ -123,6 +106,30 @@ class MendController extends ThinkController {
$this->display();
}
}
//补链详情
public function shiftInfo()
{
$id = I('id');
$info = M("shift_task")->where("id = {$id} and status = 0")->find();
if(empty($info)){
$this->error("补链不存在或已处理");
}
$info['user_id'] = json_decode($info['shift_ids'])[0];
$info['order_time'] = date("Y-m-d",$info['order_time']);
$this->assign('data',$info);
$this->display();
}
//取消补链
public function cancelShift()
{
$id = I('id');
$status = M('ShiftTask')->where(['id' => $id,'status' => 0])->save(['status' => 2]);
if ($status) {
$this->success('取消补链成功', U('lists'), 2);
} else {
$this->error("取消失败,或补链已生效",U('lists'));
}
}
}

@ -32,7 +32,6 @@ class PublicController extends \Think\Controller
$Member = D('Member');
if ($Member->login($uid)) { //登录用户
//TODO:跳转到登录前页面
$this->success('登录成功!', U('Index/index'));
} else {

@ -44,9 +44,17 @@ class RechargeSumController extends ThinkController{
$rmap['register_time'] = $map['register_time'] = array('BETWEEN',array($startDate,$endDate));
$map['play_time'] = array('BETWEEN',array($startDate,$endDate));
$map['pay_time'] = array('BETWEEN',array($startDate,$endDate));
if(!empty($_REQUEST['game_id'])){
$map['game_id'] = $_REQUEST['game_id'];
$rmap['fgame_id'] = $_REQUEST['game_id'];
if(!empty($_REQUEST['game_type'])){
$map['sdk_version'] = $_REQUEST['game_type'];
$rmap['sdk_version'] = $_REQUEST['game_type'];
}
if(!empty($_REQUEST['game_name'])){
$rmap['game_id'] = $map['game_id'] = ['in', array_column(getGameByName($_REQUEST['game_name'], $_REQUEST['game_type']), 'id')];
}
if (!empty($_REQUEST['server_name'])) {
$rmap['server_name'] = $map['server_name'] = $_REQUEST['server_name'];
}
if($_REQUEST['bindcoin']==1) {
@ -54,7 +62,8 @@ class RechargeSumController extends ThinkController{
}
//当天注册人数
$registerNum = D('User')->where(array_merge($rmap,array('puid'=>0)))->getField("id",true);
$registerNum = D('User')->where(array_merge($rmap,array('puid'=>0)))->join("tab_user_play on tab_user.id = tab_user_play.user_id and tab_user.fgame_id = tab_user_play.game_id")->field("tab_user.id")->select();
$registerNum = $registerNum ? array_column($registerNum, 'id') : [];
//当天活跃人数
$livenNum = D('UserPlay')->where($map)->count("id");
@ -67,7 +76,8 @@ class RechargeSumController extends ThinkController{
}
$map['pay_status'] = 1;
$newAddPay = D('Spend')->where(array_merge($map,array('_string'=>'( small_id = 0 or small_id = user_id)')))->sum('pay_amount');
$newAddPay = D('Spend')->where(array_merge($map,array('_string'=>'( small_id = 0 or small_id = user_id)')))->sum('pay_amount');
//当天累计付费
unset($map['user_id']);
$accumulated = D('Spend')->where($map)->sum('pay_amount');

@ -42,7 +42,7 @@ class SpendController extends ThinkController {
if($_REQUEST['game_name']=='全部'){
unset($_REQUEST['game_name']);
}else{
$map['tab_spend.game_name']=$_REQUEST['game_name'];
$map['tab_spend.game_id']= ['in', array_column(getGameByName($_REQUEST['game_name'], $_REQUEST['game_type']), 'id')];
unset($_REQUEST['game_name']);
}
}

@ -77,10 +77,9 @@ class MemberModel extends Model {
'username' => $user['nickname'],
'last_login_time' => $user['last_login_time'],
);
session('user_auth', $auth);
session('user_auth_sign', data_auth_sign($auth));
setcookie(session_name(),session_id(),time()+3600);
}
public function getNickName($uid){

@ -0,0 +1,36 @@
<extend name="Public/base" />
<!-- 管理员用户组新增和编辑页面 -->
<block name="body">
<form action="{:U('Member/save_device_bans')}" enctype="application/x-www-form-urlencoded" method="POST"
class="form-horizontal form_info_ml">
<div class="formtitle"><span>新增风控</span></div>
<ul class="form_info ">
<input type="hidden" name="id" value="{$auth_group.id}" />
<li>
<label>类型</label>
<select id="type" name="type" class="select_gallery">
<option value="1">设备号</option>
<option value="2">IP</option>
</select>
</li>
<li>
<label>详情</label><input type="text" name="tag" class="" placeholder="风控标识" value="{:I('tag')}">
</li>
<li>
<label>&nbsp;</label><input type="submit" id="submit" value="确认保存" target-form="form-horizontal" class="form_btn ajax-post">
</li>
</ul>
</form>
<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="AuthManager/index">
</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">
</block>

@ -0,0 +1,221 @@
<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">说明此处显示设备、IP等风控记录</p>
</div>
<div class="cf top_nav_list">
<!-- <div class="fl button_list">
<a class="confirm ajax-post" id="dtnn" target-form="ids" url="{:U('Member/delprovide')}"><span class="button_icon button_icon2 "></span>批量删除</a>
</div> -->
<!-- 高级搜索 -->
<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="1" <?php echo I('type') == 1 ? "selected" : "" ?> >设备号</option>
<option value="2" <?php echo I('type') == 2 ? "selected" : "" ?> >IP</option>
</select>
</div>
<div class="input-list">
<input type="text" name="tag" class="" placeholder="风控标识" value="{:I('tag')}">
</div>
<div class="input-list">
<a class="sch-btn" href="javascript:;" id="search"
url="{:U('Member/device_bans_list','model='.$model['name'] . '&row=' . I('row'),false)}">
搜索
</a>
</div>
<div class="input-list">
<a class="sch-btn" href="{:U('Member/save_device_bans')}">
新增
</a>
</div>
</div>
</div>
<!-- 数据列表 -->
<div class="data_list">
<div class="">
<table>
<!-- 表头 -->
<thead>
<tr>
<!-- <th class="">
<input class="check-all" type="checkbox">
</th> -->
<th>ID</th>
<th>类型</th>
<th>标识</th>
<th>操作人</th>
<th>操作时间</th>
<th>操作</th>
</tr>
</thead>
<!-- 列表 -->
<tbody>
<empty name="list_data">
<td colspan="8" class="text-center">aOh! 暂时还没有内容!</td>
<else/>
<volist name="list_data" id="data">
<tr>
<!-- <td><input class="ids" type="checkbox" value="{$data['id']}" name="ids"></td> -->
<td>{$data.id}</td>
<td><?php echo $data['type'] == 1 ? "设备号" : "IP";?></td>
<td>{$data.tag}</td>
<td>{:get_admin_nickname($data['operator_id'])}</td>
<td>{$data.create_time|date='Y-m-d H:i:s',###}</td>
<td>
<a class="confirm ajax-post" href="{:U('Member/save_device_bans',array('id'=>$data['id']))}">解除</a>
</td>
</tr>
</volist>
</empty>
</tbody>
</table>
</div>
</div>
<div class="page">
{$_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="Member/login_record">
</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 type="text/javascript">
</script>
<script type="text/javascript">
//导航高亮
highlight_subnav("{:U('Member/login_record')}");
$(function () {
<volist name = ":I('get.')" id = "vo" > Think.setValue('{$key}', "{$vo}");
</volist >
$(".select_gallery").select2();
//搜索功能
$("#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;
}
var start = $("#time-start").val();
var end = $("#time-end").val();
if (start !='' && end != ''){
if (Date.parse(start) > Date.parse(end)){
layer.msg('开始时间必须小于等于结束时间');
return false;
}
}
window.location.href = url;
});
//回车自动提交
$('.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
});
$('#datetimepicker').datetimepicker({
format: 'yyyy-mm-dd',
language: "zh-CN",
minView: 2,
autoclose: true,
pickerPosition: 'bottom-left'
})
$(".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();
});
var a = $('.i_list_li li a');
$('#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);
})
});
})
</script>
</block>

@ -204,7 +204,13 @@
<span class="notice-text">此处显示该玩家的金币提现记录</span>
</td>
</tr>
<tr>
<td class="l noticeinfo">角色信息</td>
<td class="r">
<span id="role" class="table_click table_btn player_table_btn"><span class="table_click_text">点击查看</span></span>
<span class="notice-text">点击查看该用户游戏角色信息</span>
</td>
</tr>
<tr>
<td class="l noticeinfo">游戏登录记录</td>
<td class="r">
@ -297,6 +303,17 @@
content: [url + 'admin.php?s=/Member/chax/id/' + id + '' , 'no']
});
});
$("#role").click(function () {
layer.open({
type: 2,
title: "【游戏付费记录】列表",
shadeClose: true,
shade: 0.8,
area: ['70%', '80%'],
content: [url + 'admin.php?s=/Member/role_list/user_id/' + id + '' , 'no']
});
});
$('#tixian').click(function() {
layer.open({

@ -58,13 +58,25 @@
</div>
</div>
<div class="input-list input-list-game 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>
<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 input-list-game search_label_rehab">
<select id="game_name" name="game_name" class="select_gallery" >
<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>
</div>
<div class="input-list input-list-server search_label_rehab">
<select id="server_name" name="server_name" class="select_gallery" style="width:120px;">
<option value="">区服名称</option>
</select>
</div>
<div class="input-list">
<input type="text" name="login_ip" class="" placeholder="登录IP" value="{:I('login_ip')}">
</div>
@ -230,6 +242,51 @@
})
});
var game_name = "{:I('game_name')}";
$("#game_type").change(function(){
$.ajax({
url:"{:U('Ajax/getGameList')}",
type:"get",
data:{sdk_type:$("#game_type option:selected").val()},
dataType:'json',
success:function(response){
str = '<option value="">游戏名称</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){
str += "<option value='"+data[i].relation_game_name+"' "+(game_name && data[i].relation_game_name == game_name?'selected':'')+">"+data[i].relation_game_name+"</option>"
}
$("#game_name").empty();
$("#game_name").append(str);
$("#game_name").select2();
$("#game_name").change();
}
})
});
$("#game_type").change();
var game_server = "{:I('server_name')}";
$("#game_name").change(function(){
$.ajax({
url:"{:U('Ajax/getGmeServer')}",
type:"post",
data:{sdk_version:$("#game_type option:selected").val(), game_name:$("#game_name option:selected").val()},
dataType:'json',
success:function(data){
str = "<option value=''>请选择区服</option>";
for (var i in data){
str += "<option value='"+data[i].server_name+"' "+(game_server && data[i].server_name == game_server?'selected':'')+">"+data[i].server_name+"</option>"
}
$("#server_name").empty();
$("#server_name").append(str);
$("#server_name").select2();
}
})
});
})
</script>
</block>

@ -0,0 +1,76 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta charset="UTF-8">
<title>游戏角色列表|----软件管理平台</title>
<link href="http://admin.vlcms.com/Public/icon.ico" type="image/x-icon" rel="shortcut icon">
<link rel="stylesheet" type="text/css" href="__CSS__/base.css" media="all">
<link rel="stylesheet" type="text/css" href="__CSS__/common.css" media="all">
<link rel="stylesheet" type="text/css" href="__CSS__/module.css">
<link rel="stylesheet" type="text/css" href="__CSS__/style.css" media="all">
<link rel="stylesheet" type="text/css" href="__CSS__/default_color.css" media="all">
<script type="text/javascript" src="__STATIC__/jquery-2.0.3.min.js"></script>
<script type="text/javascript" src="__JS__/jquery.mousewheel.js"></script>
</head>
<style>
html{width:100%;min-width: auto;}
body {
padding: 0px;
}
</style>
<body>
<div id="main" class="main" style="min-height: 342px;width: 97%;">
<!-- 数据列表 -->
<div class="data_list box_mt">
<div class="" s>
<table>
<!-- 表头 -->
<thead>
<tr>
<th>玩家账号</th>
<th>游戏名称</th>
<th>游戏区服</th>
<th>角色ID</th>
<th>角色名</th>
<th>游戏等级</th>
<th>所属推广员</th>
<th>最后登陆时间</th>
<th>最后登陆IP</th>
</tr>
</thead>
<!-- 列表 -->
<tbody>
<volist name="list" id="data">
<tr>
<td>{$data.user_account}</td>
<td>{$data.game_name}</td>
<td>{$data.server_name}</td>
<td>{$data.role_id}</td>
<td>{$data.role_name}</td>
<td>{$data.role_level}</td>
<td>{$data.promote_account}</td>
<td>{$data.play_time|date='Y-m-d H:i:s',###}</td>
<td>{$data.play_ip}</td>
</tr>
</volist>
<!-- <tr class="data_summary">
<td>汇总</td>
<td colspan="8">
当页提现:{:null_to_0(array_sum(array_column($list_data,'coin')))}
今日提现:{$ttotal|default='0.00'}
累计提现:{$total|default='0.00'}
累计手续费:{$poundage|default='0.00'}
</td>
</tr> -->
</tbody>
</table>
</div>
</div>
<div class="page">
{$_page}
</div>
</div>
</body>
</html>

@ -113,13 +113,26 @@
</select>
</div>
<div class="input-list input-list-game search_label_rehab">
<select id="game_id" name="game_id" class="select_gallery" >
<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 input-list-game search_label_rehab">
<select id="game_name" name="game_name" class="select_gallery" >
<option value="">游戏名称</option>
<volist name=":get_game_list()" id="vo">
<!-- <volist name=":get_game_list(null, $_GET['game_type'])" id="vo">
<option game-id="{$vo.id}" value="{$vo.id}">{$vo.game_name}</option>
</volist>
</volist> -->
</select>
</div>
<div class="input-list input-list-server search_label_rehab">
<select id="server_name" name="server_name" class="select_gallery" style="width:120px;">
<option value="">区服名称</option>
</select>
</div>
<br>
<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>
@ -150,6 +163,10 @@
<!-- <div class="input-list">
<a class="sch-btn" href="{:U('Export/expUser',array_merge(['id'=>3],I('get.')))}">导出</a>
</div> -->
<div class="fl button_list">
<a target-form="ids" onclick="shenhe(0)"><span class="button_icon button_icon5 "></span>批量锁定</a>
<a id="dtnn" target-form="ids" onclick="shenhe(1)"><span class="button_icon button_icon9 "></span>批量开启</a>
</div>
</div>
</div>
@ -161,6 +178,9 @@
<!-- 表头 -->
<thead>
<tr>
<th class="" style="width: 50px;">
<input class="check-all" type="checkbox">
</th>
<th>账号ID</th>
<if condition="I('type') eq 2">
<th>第三方来源</th>
@ -213,6 +233,7 @@
<else/>
<volist name="list_data" id="data">
<tr>
<td ><input class="ids" type="checkbox" value="{$data.id}" name="ids[]"></td>
<td >{$data.id}</td>
<if condition="I('type') eq 2">
<td >{:get_registertype($data['register_type'])}</td>
@ -425,22 +446,70 @@ $(function(){
});
$("#promote_level").change();
})
function shenhe(){
var game_name = "{:I('game_name')}";
$("#game_type").change(function(){
$.ajax({
url:"{:U('Ajax/getGameList')}",
type:"get",
data:{sdk_type:$("#game_type option:selected").val()},
dataType:'json',
success:function(response){
str = '<option value="">游戏名称</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){
str += "<option value='"+data[i].relation_game_name+"' "+(game_name && data[i].relation_game_name == game_name?'selected':'')+">"+data[i].relation_game_name+"</option>"
}
$("#game_name").empty();
$("#game_name").append(str);
$("#game_name").select2();
$("#game_name").change();
}
})
});
$("#game_type").change();
var game_server = "{:I('server_name')}";
$("#game_name").change(function(){
$.ajax({
url:"{:U('Ajax/getGmeServer')}",
type:"post",
data:{sdk_version:$("#game_type option:selected").val(), game_name:$("#game_name option:selected").val()},
dataType:'json',
success:function(data){
str = "<option value=''>请选择区服</option>";
for (var i in data){
str += "<option value='"+data[i].server_name+"' "+(game_server && data[i].server_name == game_server?'selected':'')+">"+data[i].server_name+"</option>"
}
$("#server_name").empty();
$("#server_name").append(str);
$("#server_name").select2();
}
})
});
function shenhe(status){
var text = $("input:checkbox[name='ids[]']:checked").map(function(index,elem) {
return $(elem).val();
}).get().join(',');
console.log(text);
$.ajax({
cache: true,
type: "POST",
url:"{:U('Member/age_check')}",
data:{id:text},// 你的formid
url:"{:U('Member/lock_status')}",
data:{id:text, lock_status:status},// 你的formid
async: false,
error: function(data) {
layer.alert("服务器故障,请稍后重试!",{icon: 2});
},
success: function(data) {
var obj = JSON.parse(data);
layer.alert(obj.info,{icon:obj.status})
// var obj = JSON.parse(data);
// layer.alert(obj.info,{icon:obj.status})
layer.alert(data.info,{icon:data.status})
window.location.reload()
}
});
}

@ -84,6 +84,13 @@
</td>
</tr>
<tr>
<td class="l noticeinfo">订单日期:</td>
<td class="r table_radio">
<input type="text" name="order_time" class="date" value="{:I('order_time')}" placeholder="订单日期" />
</td>
</tr>
<tr>
<td class="l noticeinfo">换绑类型</td>
<td class="r table_radio">
@ -159,7 +166,6 @@ Think.setValue("prmoote_id_to", {$data.promote_id|default = "''"});
$('#submit').click(function(){
$('#form').submit();
});
$(function(){
$('.time').datetimepicker({
format: 'yyyy-mm-dd hh:ii',

@ -80,7 +80,14 @@
<else/>
{:get_promote_name($data['promote_id'])}
</if></td>
<td><a style="width:100%;text-align:center" href="{:U('Mend/edit?id='.$data['id'])}">补链</a></td>
<td>
<if condition="getIsTask($data['id']) eq 0 ">
<a style="width:100%;text-align:center" href="{:U('Mend/edit?id='.$data['id'])}">补链</a>
<else/>
<a style="width:100%;text-align:center;color: #f00;" href="{:U('Mend/shiftInfo?id='.getIsTask($data['id']))}">补链中</a>
</if>
</td>
</tr>
</volist>
</empty>

@ -0,0 +1,173 @@
<extend name="Public/base" />
<block name="body">
<link rel="stylesheet" type="text/css" href="__CSS__/admin_table.css" media="all">
<script type="text/javascript" src="__STATIC__/uploadify/jquery.uploadify.min.js"></script>
<link rel="stylesheet" href="__CSS__/select2.min.css" type="text/css" />
<script type="text/javascript" src="__JS__/select2.min.js"></script>
<style>
.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;}
.tabcon1711 .select2-container--default .select2-selection--single{
font-size: 12px;
color: #555;
vertical-align: middle;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 4px;
background-color: #fff;
border: 1px solid #ccc;
-webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,0.075);
-moz-box-shadow: inset 0 1px 1px rgba(0,0,0,0.075);
box-shadow: inset 0 1px 1px rgba(0,0,0,0.075);
-webkit-transition: border linear .2s, box-shadow linear .2s;
-moz-transition: border linear .2s, box-shadow linear .2s;
-o-transition: border linear .2s, box-shadow linear .2s;
transition: border linear .2s, box-shadow linear .2s;height:30px;}
.tabcon1711 .select2-container--default .select2-selection--single .select2-selection__rendered {line-height: 30px;}
.tabcon1711 .select2-container--default .select2-selection--single .select2-selection__arrow {height:30px;}
.tabcon1711 .select2-container--default .select2-search--dropdown .select2-search__field {
height:26px;line-height:26px;font-size:12px;
}
.tabcon1711 .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="tab-content tabcon1711">
<table border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td class="l noticeinfo">用户账号</td>
<td class="r table_radio">
<input name="account" value="{:get_promote_name($data['promote_id'])}" disabled readonly type="text" class="">
</td>
</tr>
<tr>
<td class="l noticeinfo">修改前渠道</td>
<td class="r table_radio">
<input name="old_promote_id" value="{:get_promote_name($data['from_promote_id'])}" disabled readonly type="text" class="">
<span class="notice-text"></span>
</td>
</tr>
<tr>
<td class="l noticeinfo">补链后渠道</td>
<td class="r table_radio">
<input name="old_promote_id" value="{:get_promote_name($data['to_promote_id'])}" disabled readonly type="text" class="">
<span class="notice-text"></span>
</td>
</tr>
<tr>
<td class="l noticeinfo">订单日期:</td>
<td class="r table_radio">
<input type="text" readonly value="{$data['order_time']}" placeholder="订单日期" />
</td>
</tr>
<tr>
<td class="l noticeinfo">换绑类型</td>
<td class="r table_radio">
<input name="bind_type" value="1" type="radio">In
<input name="bind_type" value="2" type="radio">Out
</td>
</tr>
<tr>
<td class="l noticeinfo">备注</td>
<td class="r table_radio">
<textarea name="remark" readonly class="txt_area1">{$data['remark']}</textarea>
<span class="notice-text"></span>
</td>
</tr>
</tbody>
</table>
<div class="form-item cf">
<button class="submit_btn mlspacing" id="submit" data-id="{$data.id}">
取消补链
</button>
<a class="submit_btn " alt="返回上一页" title="返回上一页" href="javascript:window.history.back();" >
返回
</a>
</div>
</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="Mend/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 type="text/javascript">
var start = $("#bind_time").val();
$('#bind_time').datetimepicker({
format: 'yyyy-mm-dd',
language:"zh-CN",
minView:2,
autoclose:true
});
<volist name=":I('get.')" id="vo">
Think.setValue('{$key}',"{$vo}");
</volist>
$(".select_gallery").select2();
//导航高亮
highlight_subnav('{:U('Mend/lists')}');
Think.setValue("prmoote_id_to", {$data.promote_id|default = "''"});
$('#submit').click(function(){
//获取id
var taskid = $(this).data("id");
window.location.href = "{:U('Mend/cancelShift')}"+"&id="+taskid;
});
$(function(){
$('.time').datetimepicker({
format: 'yyyy-mm-dd hh:ii',
language:"zh-CN",
minView:2,
autoclose:true
});
$('.date').datetimepicker({
format: 'yyyy-mm-dd',
language:"zh-CN",
minView:2,
autoclose:true
});
showTab();
});
</script>
</block>

@ -65,13 +65,25 @@
</volist>
</select>
</div> -->
<div class="input-list input-list-promote search_label_rehab">
<select id="game_id" name="game_id" class="select_gallery" >
<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 input-list-game search_label_rehab">
<select id="game_name" name="game_name" class="select_gallery" >
<option value="">游戏名称</option>
<volist name=":get_game_list()" id="vo">
<option value="{$vo.id}">{$vo.game_name}</option>
</volist>
</select>
<!-- <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>
</div>
<div class="input-list input-list-server search_label_rehab">
<select id="server_name" name="server_name" class="select_gallery" style="width:120px;">
<option value="">区服名称</option>
</select>
</div>
<div class="input-list search_item input-list-gamenoticestatus">
<select name="promote_level" style="color:#444" class="select_gallery" id="promote_level">
@ -309,6 +321,51 @@ $(function(){
})
});
$("#promote_level").change();
var game_name = "{:I('game_name')}";
$("#game_type").change(function(){
$.ajax({
url:"{:U('Ajax/getGameList')}",
type:"get",
data:{sdk_type:$("#game_type option:selected").val()},
dataType:'json',
success:function(response){
str = '<option value="">游戏名称</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){
str += "<option value='"+data[i].relation_game_name+"' "+(game_name && data[i].relation_game_name == game_name?'selected':'')+">"+data[i].relation_game_name+"</option>"
}
$("#game_name").empty();
$("#game_name").append(str);
$("#game_name").select2();
$("#game_name").change();
}
})
});
$("#game_type").change();
var game_server = "{:I('server_name')}";
$("#game_name").change(function(){
$.ajax({
url:"{:U('Ajax/getGmeServer')}",
type:"post",
data:{sdk_version:$("#game_type option:selected").val(), game_name:$("#game_name option:selected").val()},
dataType:'json',
success:function(data){
str = "<option value=''>请选择区服</option>";
for (var i in data){
str += "<option value='"+data[i].server_name+"' "+(game_server && data[i].server_name == game_server?'selected':'')+">"+data[i].server_name+"</option>"
}
$("#server_name").empty();
$("#server_name").append(str);
$("#server_name").select2();
}
})
});
})
</script>
</block>

@ -58,13 +58,28 @@
</div>
</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 input-list-game search_label_rehab">
<select id="game_name" name="game_name" class="select_gallery" >
<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>
</div>
<!-- <div class="input-list input-list-game search_label_rehab">
<select id="game_id" name="game_name" class="select_gallery" style="width:120px;">
<option value="">游戏名称</option>
<volist name=":get_game_list()" id="vo">
<option game-id="{$vo.id}" value="{$vo.game_name}">{$vo.game_name}</option>
</volist>
</select>
</div>
</div> -->
<div class="input-list input-list-server search_label_rehab">
<select id="server_name" name="server_name" class="select_gallery" style="width:120px;">
<option value="">区服名称</option>
@ -132,6 +147,7 @@
<thead>
<tr>
<th>支付订单号</th>
<th>CP订单号</th>
<th><a class="paixu" data-order='pay_time'>
充值时间
@ -161,6 +177,7 @@
<volist name="list_data" id="data">
<tr>
<td>{$data.pay_order_number}</td>
<td>{$data.extend}</td>
<td>{:set_show_time($data['pay_time'])}</td>
<td>{$data.user_account}<gt name="data.small_id" value="0"><neq name="data.small_id" value="$data.user_id">{$data.small_account}</neq></gt></td>
<td>{$data.game_name}</td>
@ -461,27 +478,7 @@
})
$("#game_id").change(function(){
$.ajax({
url:"{:U('Ajax/getSpendServer')}",
type:"post",
data:{game_id:$("#game_id option:selected").attr('game-id')},
dataType:'json',
success:function(data){
str = "<option value=''>请选择区服</option>";
for (var i in data){
str += "<option value='"+data[i].server_name+"'>"+data[i].server_name+"</option>"
}
$("#server_name").empty();
$("#server_name").append(str);
$("#server_name").select2();
}
})
});
var promote_id = "{:I('promote_id')}";
console.log(promote_id);
$("#promote_level").change(function(){
$.ajax({
url:"{:U('Ajax/getPromotersByLevel')}",
@ -506,13 +503,59 @@
});
$("#promote_level").change();
var game_id = "{:I('game_name')}";
var game_server = "{:I('server_name')}";
if(game_id){
// var game_id = "{:I('game_name')}";
// var game_server = "{:I('server_name')}";
// if(game_id){
// $.ajax({
// url:"{:U('Ajax/getSpendServer')}",
// type:"post",
// data:{game_id:game_id,type:2},
// dataType:'json',
// success:function(data){
// str = "<option value=''>请选择区服</option>";
// for (var i in data){
// str += "<option value='"+data[i].server_name+"' "+(game_server && data[i].server_name == game_server?'selected':'')+">"+data[i].server_name+"</option>"
// }
// $("#server_name").empty();
// $("#server_name").append(str);
// $("#server_name").select2();
// }
// })
// }
var game_name = "{:I('game_name')}";
$("#game_type").change(function(){
$.ajax({
url:"{:U('Ajax/getGameList')}",
type:"get",
data:{sdk_type:$("#game_type option:selected").val()},
dataType:'json',
success:function(response){
str = '<option value="">游戏名称</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){
str += "<option value='"+data[i].relation_game_name+"' "+(game_name && data[i].relation_game_name == game_name?'selected':'')+">"+data[i].relation_game_name+"</option>"
}
$("#game_name").empty();
$("#game_name").append(str);
$("#game_name").select2();
$("#game_name").change();
}
})
});
$("#game_type").change();
var game_server = "{:I('server_name')}";
$("#game_name").change(function(){
$.ajax({
url:"{:U('Ajax/getSpendServer')}",
url:"{:U('Ajax/getGmeServer')}",
type:"post",
data:{game_id:game_id,type:2},
data:{sdk_version:$("#game_type option:selected").val(), game_name:$("#game_name option:selected").val()},
dataType:'json',
success:function(data){
str = "<option value=''>请选择区服</option>";
@ -522,10 +565,9 @@
$("#server_name").empty();
$("#server_name").append(str);
$("#server_name").select2();
}
})
}
});
/**

@ -55,6 +55,9 @@
<div class="input-list">
<input type="text" name="user_account" class="" value="{:I('user_account')}" placeholder="玩家账号">&nbsp;&nbsp;&nbsp;
</div>
<div class="input-list">
<input type="text" name="role_name" class="" value="{:I('role_name')}" placeholder="角色名称">&nbsp;&nbsp;&nbsp;
</div>
<div class="input-list input-list-game search_label_rehab">
<select id="game_id" name="game_name" class="select_gallery" >
<option value="">游戏名称</option>

@ -76,14 +76,16 @@ class ApplyService {
public function getDownloadUrl($apply)
{
$host = Request::getHost();
$host = C('DOMAIN_DOWNLOAD');
$host = $host ? $host : Request::getHost();
$code = $this->encodeApplyCode($apply, self::ENCRYPT_TYPE_DOWNLOAD);
return $host . '/index.php?s=/Home/Download/index/code/' . $code;
}
public function getLandingPageUrl($apply)
{
$host = Request::getHost();
$host = C('DOMAIN_DOWNLOAD');
$host = $host ? $host : Request::getHost();
$code = $this->encodeApplyCode($apply, self::ENCRYPT_TYPE_LANDING_PAGE);
return $host . '/index.php?s=/Home/Home/landingPage/code/' . $code;
}

@ -4,6 +4,7 @@ namespace Base\Service;
use Base\Model\PromoteModel;
use Base\Model\ApplyModel;
use Base\Tool\Base62;
use Base\Tool\PlistDemo;
class GameSourceService {
@ -136,6 +137,7 @@ class GameSourceService {
$oldLocalPath = $localPath;
$localPath = str_replace('Uploads/SourcePack', 'Uploads/Ios/original', $oldLocalPath);
$originalUrl = $relativeUrl;
$relativeUrl = str_replace('Uploads/SourcePack', 'Uploads/Ios/original', $relativeUrl);
copy($oldLocalPath, $localPath);
}
$status = $this->packChannel($localPath, $game, $gameSource);
@ -333,7 +335,7 @@ class GameSourceService {
}
$xml = new \DOMDocument();
$xml->load(ROOTTT . 'Uploads/Plist/testdemo.Plist');
$xml->loadXML(PlistDemo::$content);
$online = $xml->getElementsByTagName('dict'); //查找节点
$elements = $online->item(1)->getElementsByTagName('string'); //第二个节点下所有string
foreach ($elements as $element) {

@ -0,0 +1,48 @@
<?php
namespace Base\Tool;
/**
* 生成Plist的demo
* @author elf<360197197@qq.com>
*/
class PlistDemo
{
public static $content = '<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>items</key>
<array>
<dict>
<key>assets</key>
<array>
<dict>
<key>kind</key>
<string>software-package</string>
<key>url</key>
<string>ipa_url</string>
</dict>
<dict>
<key>kind</key>
<string>display-image</string>
<key>needs-shine</key>
<true/>
<key>url</key>
<string>icon</string>
</dict>
</array><key>metadata</key>
<dict>
<key>bundle-identifier</key>
<string>com.dell</string>
<key>bundle-version</key>
<string>1.0.0</string>
<key>kind</key>
<string>software</string>
<key>title</key>
<string>mchdemo</string>
</dict>
</dict>
</array>
</dict>
</plist>';
}

@ -868,6 +868,8 @@ function is_check_account($account){
}
if($sdk_type==2){
$map['sdk_version']=1;
} else if ($sdk_type == 3) {
$map['sdk_version']=2;
}
$lists = $game->field('id,game_name,sdk_version,relation_game_name,icon,relation_game_id,game_status,display_site,dow_num')->where($map)->select();
if(empty($lists)){return false;}
@ -2834,3 +2836,23 @@ function index_by_column($column, $items)
}
return $records;
}
/**
* [获取用户是否补链中]
* @param integer $user_id [description]
* @return bool
*/
function getIsTask($user_id){
$shift = M("shift_task");
$map=array(
"status"=>0,
"shift_ids"=>array("LIKE","%\"{$user_id}\"%")
);
$shiftres = $shift->field("id")->where($map)->find();
if(empty($shiftres)){
return 0;
}else{
return $shiftres['id'];
}
}

@ -252,7 +252,7 @@ class BaseController extends HomeController
}
//验证安全密码--视图
public function verifyPasswordView($modelList, $metaTitle)
public function verifyPasswordView($modelList, $show = true)
{
$securityCode = empty(session('game_divide_second_pwd')) ? '' : session('game_divide_second_pwd');//安全密码
$model = new \User\Api\PromoteApi();
@ -260,11 +260,14 @@ class BaseController extends HomeController
if ($res) {
return true;
}
if ($show) {
$this->assign('modelList', $modelList);
$this->assign('meta_title', '安全密码');
$this->display('Public/verify_password');
exit;
}
$this->assign('modelList', $modelList);
$this->assign('metaTitle', $metaTitle);
$this->display('Public/verify_password');
exit;
return false;
}
//验证安全密码

@ -14,6 +14,10 @@ class DownController extends Controller {
$this->display();
}
public function down_file($game_id=0,$promote_id=0){
// 旧版兼容
A('Download')->index();
die();
$applyModel = M('Apply','tab_');
$map['status'] = 1;
$map['enable_status'] = 1;

@ -19,18 +19,28 @@ class DownloadController extends Controller {
public function index()
{
$code = I('code', '');
if ($code == '') {
$gameId = I('game_id', 0);
$promoteId = I('promote_id', 0);
if ($code == '' && ($gameId == 0 || $promoteId == 0)) {
$this->redirect("download/downloadError", ['message' => '访问错误']);
}
$applyService = new ApplyService();
$data = $applyService->decodeApplyCode($code);
$result = $applyService->checkApplyCode($data, ApplyService::ENCRYPT_TYPE_DOWNLOAD);
if (!$result['status']) {
$this->error($result['message']);
$blackList = [];
if (in_array($code, $blackList) || in_array('game_id/' . $gameId . '/promote_id/' . $promoteId, $blackList)) {
$this->redirect("download/downloadError", ['message' => '该链接已被禁']);
}
if ($code != '') {
$applyService = new ApplyService();
$data = $applyService->decodeApplyCode($code);
$result = $applyService->checkApplyCode($data, ApplyService::ENCRYPT_TYPE_DOWNLOAD);
if (!$result['status']) {
$this->error($result['message']);
}
$gameId = $data['game_id'];
$promoteId = $data['promote_id'];
}
$gameId = $data['game_id'];
$promoteId = $data['promote_id'];
$map = [];
$map['status'] = 1;

@ -2,6 +2,7 @@
namespace Home\Controller;
use Base\Model\Model;
use OT\DataDictionary;
use Base\Repository\PromoteRepository;
use Base\Repository\SpendRepository;
@ -12,12 +13,144 @@ use Base\Repository\UserRepository;
*/
class FinanceController extends BaseController
{
//提现状态
public static $withdrawStatus = [
-1 => '审核未通过',
0 => '待审核',
1 => '汇款中',
2 => '已汇款',
];
//权限过滤
private function purview()
{
$this->loginPromote = $this->getLoginPromote();
if ($this->loginPromote['level'] != 1) {
$this->error('权限异常');
}
return true;
}
private function getDayList($beginTime, $endTime)
{
$dayList = [];
do {
$dayList[] = date('Y-m-d', $beginTime);
$beginTime += 24 * 60 * 60;
} while ($beginTime < $endTime);
return $dayList;
}
private function assembleRecords($items, $keys, $valueColumn, $keyColumn = 'day')
{
$records = [];
foreach ($keys as $key) {
$value = 0;
foreach ($items as $item) {
if ($item[$keyColumn] == $key) {
$value = $item[$valueColumn];
}
}
$records[$key] = $value;
}
return $records;
}
//生成提现单号
private function produceWithdrawNumber()
{
$prefix = 'WD_';
$number = '';
while (true) {
$randomNum = rand(10, 99);
$number = $prefix . time() . $randomNum;
$map['widthdraw_number'] = $number;
$res = M('withdraw', 'tab_')->where($map)->getField('id');
if (!$res) {
break;
}
}
return $number;
}
//结算中心
public function index()
{
//是否是会长
$this->purview();
//验证安全密码
$metaTitle = '结算明细';
$modelList = ['财务管理', $metaTitle];
$this->verifyPasswordView($modelList);
$model = M('spend', 'tab_');
$thisDay = strtotime(date('Y-m-d'));
$thisMonth = strtotime(date('Y-m'));
$yesterday = strtotime(date('Y-m-d', strtotime('-1 day', time())));
$nowTime = date('Y-m-d');
$initBegTime = date('Y-m-d', strtotime('-6 day', strtotime($nowTime)));
$initBegTime = empty(I('begtime')) ? $initBegTime : I('begtime');
$initEndTime = $nowTime;
$initEndTime = empty(I('endtime')) ? $initEndTime : I('endtime');
$begTime = strtotime($initBegTime);
$endTime = strtotime($initEndTime);
$endTime = $endTime + 3600 * 24;
$map['chain'] = ['like', $this->loginPromote['chain'] . $this->loginPromote['id'] . '/%'];
$promoteIds = M('promote', 'tab_')->where($map)->getField('id', true);
$promoteIds[] = $this->loginPromote['id'];
$promoteIds = implode(',', $promoteIds);
$map = [];
$map['pay_status'] = 1;
$map['promote_id'] = ['in', $promoteIds];
$income = $model->field("sum(if(pay_time < $thisDay, if(selle_ratio > 0, pay_amount * selle_ratio, 0), 0)) as history_income,
sum(if(pay_time >= $thisMonth, if(selle_ratio > 0, pay_amount * selle_ratio, 0), 0)) as this_month_income,
sum(if((pay_time >= $yesterday and pay_time < $thisDay), if(selle_ratio > 0, pay_amount * selle_ratio, 0), 0)) as yesterday_income,
sum(if(pay_time < $thisDay, if(selle_status = 0, pay_amount * selle_ratio, 0), 0)) as balance")
->where($map)
->find();
foreach ($income as &$value) {
$value = bcdiv($value, 100, 2);
}
$map['pay_time'] = ['between', [$begTime, $endTime]];
$dayList = $this->getDayList($begTime, $endTime);
$data = $model->field('FROM_UNIXTIME(pay_time, "%Y-%m-%d") as day,
sum(if(selle_ratio > 0, pay_amount * selle_ratio, 0)) as income')
->where($map)
->group('day')
->select();
$data = $this->assembleRecords($data, $dayList, 'income');
foreach ($dayList as $day) {
$date = date('Ymd', strtotime($day));
$records[] = [
'day' => $date,
'income' => bcdiv($data[$day], 100, 2),
'url' => U('settlementDtl', array('begtime' => $day, 'endtime' => $day))
];
}
$this->assign('income', $income);
$this->assign('listData', $records);
$this->assign('initBegTime', $initBegTime);
$this->assign('initEndTime', $initEndTime);
$this->assign('yesterday', date('Y-m-d', $yesterday));
$this->assign('meta_title', $metaTitle);
$this->display();
}
//结算明细
public function settlementDtl()
{
//是否是会长
$this->purview();
//验证安全密码
$metaTitle = '结算明细';
$modelList = ['财务管理', $metaTitle];
$this->verifyPasswordView($modelList, $metaTitle);
$this->verifyPasswordView($modelList);
$model = M('spend', 'tab_');
$page = intval(I('get.p', 1));
@ -31,7 +164,6 @@ class FinanceController extends BaseController
$initEndTime = empty(I('endtime')) ? $initEndTime : I('endtime');
$begTime = strtotime($initBegTime);
$endTime = strtotime($initEndTime);
$loginPromote = $this->getLoginPromote();
$parameter['p'] = $page;
$parameter['row'] = $row;
@ -39,9 +171,9 @@ class FinanceController extends BaseController
$parameter['begtime'] = $initBegTime;
$parameter['endtime'] = $initEndTime;
$map['chain'] = ['like', $loginPromote['chain'] . $loginPromote['id'] . '/%'];
$map['chain'] = ['like', $this->loginPromote['chain'] . $this->loginPromote['id'] . '/%'];
$ids = M('promote', 'tab_')->where($map)->getField('id', true);
$ids[] = $loginPromote['id'];
$ids[] = $this->loginPromote['id'];
$ids = implode(',', $ids);
$map = [];
@ -57,22 +189,44 @@ class FinanceController extends BaseController
$map['pay_time'] = ['between', [$begTime, $endTime + 86399]];
}
$data = $model->field('pay_order_number,game_name,user_account,promote_account,pay_amount,pay_way,if(selle_ratio >= 0,selle_ratio,0) as selle_ratio,convert(pay_amount*if(selle_ratio >= 0,selle_ratio,0),decimal(10,2)) as income,pay_time,selle_status')
$data = $model->field('pay_order_number,game_name,user_account,promote_account,pay_amount,pay_way,if(selle_ratio >= 0,selle_ratio,0) as selle_ratio,pay_time,selle_status,pay_status,withdraw_id')
->where($map)
->order('id desc')
->page($page, $row)
->select();
$count = $model->where($map)->count();
//提现状态
$withdrawIds = [];
foreach ($data as $key => $value) {
if ($value['withdraw_id'] > 0 && !in_array($value['withdraw_id'], $withdrawIds)) {
$withdrawIds[] = $value['withdraw_id'];
}
}
$withdrawStatus = M('withdraw', 'tab_')
->where(array('id' => ['in', $withdrawIds]))
->getField('id,status');
foreach ($data as &$list) {
switch ($list['selle_status']) {
case 0:
$list['selle_status'] = '未提现';
break;
default:
$list['selle_status'] = '';
break;
//提现状态
if ($list['pay_status'] == 1) {
switch ($list['selle_status']) {
case 0:
$list['selle_status'] = '未提现';
break;
default:
if ($list['withdraw_id'] > 0) {
$list['selle_status'] = FinanceController::$withdrawStatus[$withdrawStatus[$list['withdraw_id']]];
} else {
$list['selle_status'] = '';
}
break;
}
} else {
$list['selle_status'] = '支付失败';
}
$list['income'] = bcmul($list['pay_amount'], bcdiv($list['selle_ratio'], 100, 2), 2);
$list['pay_time'] = date('Y-m-d H:i:s', $list['pay_time']);
}
@ -83,7 +237,294 @@ class FinanceController extends BaseController
$this->assign('initBegTime', $initBegTime);
$this->assign('initEndTime', $initEndTime);
$this->assign('_page', $page);
$this->assign('meta_title', '结算明细');
$this->assign('meta_title', $metaTitle);
$this->assign('modelList', $modelList);
$this->display();
}
//提现
public function withdraw()
{
//是否是会长
$this->purview();
//验证安全密码
$metaTitle = '结算明细';
$modelList = ['财务管理', $metaTitle];
$res = $this->verifyPasswordView($modelList, false);
if ($res == false) {
$data['status'] = 0;
$data['msg'] = '权限异常';
$this->ajaxReturn($data);
}
$spendModel = M('spend', 'tab_');
$thisDay = strtotime(date('Y-m-d'));
$map['chain'] = ['like', $this->loginPromote['chain'] . $this->loginPromote['id'] . '/%'];
$promoteIds = M('promote', 'tab_')->where($map)->getField('id', true);
$promoteIds[] = $this->loginPromote['id'];
$promoteIds = implode(',', $promoteIds);
$map = [];
$map['pay_status'] = 1;
$map['selle_status'] = 0;
$map['promote_id'] = ['in', $promoteIds];
$map['pay_time'] = ['lt', $thisDay];
$balance = $spendModel->field("sum(pay_amount * selle_ratio) as balance")
->where($map)
->find()['balance'];
$balance = bcdiv($balance, 100, 2);
if ($balance < 100) {
$data['status'] = 0;
$data['msg'] = '账户余额低于100元无法提现';
$this->ajaxReturn($data);
}
$spendIds = $spendModel->where($map)->getField('id', true);
if (!empty($spendIds)) {
$data['status'] = 0;
$data['msg'] = '数据异常';
$this->ajaxReturn($data);
}
$thisTime = time();
$add['sum_money'] = $balance;
$add['promote_id'] = $this->loginPromote['id'];
$add['promote_account'] = $this->loginPromote['account'];
$add['create_time'] = $thisTime;
$add['status'] = 0;
$add['widthdraw_number'] = $this->produceWithdrawNumber();
$add['settlement_end_time'] = $thisDay - 1;
M()->startTrans();//开启事物
$withdrawId = M('withdraw', 'tab_')->add($add);
if (!$withdrawId) {
M()->rollback();//事物回滚
$data['status'] = 0;
$data['msg'] = '提现失败';
$this->ajaxReturn($data);
}
$map = [];
$map['id'] = ['in', $spendIds];
$save['selle_status'] = 1;
$save['selle_time'] = $thisTime;
$save['withdraw_id'] = $withdrawId;
$res = $spendModel->where($map)->save($save);
if ($res === false) {
M('withdraw', 'tab_')->delete($withdrawId);
M()->rollback();//事物回滚
$data['status'] = 0;
$data['msg'] = '提现失败';
$this->ajaxReturn($data);
}
M()->commit();//事物提交
$data['status'] = 1;
$data['msg'] = '提现成功';
$this->ajaxReturn($data);
}
//提现记录
public function withdrawRecord()
{
//是否是会长
$this->purview();
//验证安全密码
$metaTitle = '提现记录';
$modelList = ['财务管理', $metaTitle];
$this->verifyPasswordView($modelList);
$model = M('withdraw', 'tab_');
$page = intval(I('get.p', 1));
$page = $page ? $page : 1; //默认显示第一页数据arraypage
$row = intval(I('get.row', 10));
$withdrawNumber = I('widthdraw_number', '');
$initBegTime = I('begtime', '');
$initEndTime = I('endtime', '');
$begTime = strtotime(date('Y-m-d', strtotime($initBegTime)));
$endTime = strtotime(date('Y-m-d', strtotime($initEndTime))) + 3600 * 24;
$status = '';
$parameter['p'] = $page;
$parameter['row'] = $row;
$parameter['widthdraw_number'] = $withdrawNumber;
$parameter['begtime'] = $initBegTime;
$parameter['endtime'] = $initEndTime;
$map['promote_id'] = $this->loginPromote['id'];
if (!empty($withdrawNumber)) {
$map['widthdraw_number'] = $withdrawNumber;
}
if (!empty($initBegTime) && empty($initEndTime)) {
$map['create_time'] = ['egt', $begTime];
} elseif (empty($initBegTime) && !empty($initEndTime)) {
$map['create_time'] = ['lt', $endTime];
} elseif (!empty($initBegTime) && !empty($initEndTime)) {
$map['create_time'] = ['between', [$begTime, $endTime - 1]];
}
if (isset($_GET['status']) && $_GET['status'] !== '') {
$status = intval($_GET['status']);
if (!isset(FinanceController::$withdrawStatus[$status])) {
$this->error('参数异常');
}
$map['status'] = $status;
}
$data = $model->field('id,widthdraw_number,create_time,settlement_end_time,sum_money,status,respond')
->where($map)
->order('id desc')
->page($page, $row)
->select();
$count = $model
->where($map)
->count();
if (!empty($data)) {
foreach ($data as &$list) {
$list['create_time'] = date('Y-m-d H:i:s', $list['create_time']);
$list['settlement_end_time'] = date('Y-m-d H:i:s', $list['settlement_end_time']);
$list['status'] = FinanceController::$withdrawStatus[$list['status']];
}
}
$page = set_pagination($count, $row, $parameter);
$this->assign('listData', $data);
$this->assign('count', $count);
$this->assign('initBegTime', $initBegTime);
$this->assign('initEndTime', $initEndTime);
$this->assign('status', $status);
$this->assign('_page', $page);
$this->assign('meta_title', $metaTitle);
$this->assign('modelList', $modelList);
$this->display();
}
//提现明细
public function withdrawDtl()
{
//是否是会长
$this->purview();
//验证安全密码
$metaTitle = '提现明细';
$modelList = ['财务管理', '提现记录', $metaTitle];
$this->verifyPasswordView($modelList);
$model = M('withdraw', 'tab_');
$spendModel = M('spend', 'tab_');
$page = intval(I('get.p', 1));
$page = $page ? $page : 1; //默认显示第一页数据arraypage
$row = intval(I('get.row', 10));
$withdrawId = intval(I('get.id', 0));
if ($withdrawId == 0) {
$this->error('参数异常');
}
$withdraw = $model->field('promote_id,status')->where(array('id' => $withdrawId))->find();
if (empty($withdraw) || $withdraw['promote_id'] != $this->loginPromote['id']) {
$this->error('参数异常');
}
$gameId = intval(I('game_id', 0));
$userAccount = I('user_account', '');
$payOrderNumber = I('pay_order_number', '');
$parameter['p'] = $page;
$parameter['row'] = $row;
$parameter['id'] = $withdrawId;
$parameter['game_id'] = $gameId;
$parameter['user_account'] = $userAccount;
$parameter['pay_order_number'] = $payOrderNumber;
$map['withdraw_id'] = $withdrawId;
if (!empty($gameId)) {
$map['game_id'] = $gameId;
}
if (!empty($userAccount)) {
$map['user_account'] = $userAccount;
}
if (!empty($payOrderNumber)) {
$map['pay_order_number'] = $payOrderNumber;
}
$data = $spendModel
->field('id,pay_order_number,game_name,sdk_version,user_account,pay_amount,pay_way,selle_ratio,pay_time')
->where($map)
->order('id desc')
->page($page, $row)
->select();
$count = $spendModel
->where($map)
->count();
if (!empty($data)) {
foreach ($data as &$list) {
$list['income'] = bcmul($list['pay_amount'], bcdiv($list['selle_ratio'], 100, 2), 2);
$list['pay_time'] = date('Y-m-d H:i:s', $list['pay_time']);
switch ($list['pay_way']) {
case 2:
case 3:
case 4:
$list['pay_way_name'] = QueryController::$payWay[2];
break;
default:
$list['pay_way_name'] = QueryController::$payWay[$list['pay_way']];
break;
}
}
}
$page = set_pagination($count, $row, $parameter);
$this->assign('listData', $data);
$this->assign('count', $count);
$this->assign('status', FinanceController::$withdrawStatus[$withdraw['status']]);
$this->assign('_page', $page);
$this->assign('meta_title', $metaTitle);
$this->assign('modelList', $modelList);
$this->display();
}
//结算单
public function settlementOrder()
{
//是否是会长
$this->purview();
//验证安全密码
$metaTitle = '结算单';
$modelList = ['财务管理', '提现记录', $metaTitle];
$this->verifyPasswordView($modelList);
$model = M('withdraw', 'tab_');
$withdrawId = intval(I('get.id', 0));
if ($withdrawId == 0) {
$this->error('参数异常');
}
$withdraw = $model->find($withdrawId);
if (empty($withdraw) || $withdraw['promote_id'] != $this->loginPromote['id']) {
$this->error('参数异常');
}
$withdraw['create_time'] = date('Y-m-d H:i:s', $withdraw['create_time']);
$withdraw['settlement_end_time'] = date('Y-m-d H:i:s', $withdraw['settlement_end_time']);
$withdraw['status'] = FinanceController::$withdrawStatus[$withdraw['status']];
$map['withdraw_id'] = $withdrawId;
$data = M('spend', 'tab_')
->field('game_name,if(selle_ratio >= 0,selle_ratio,0) as selle_ratio,pay_way,sum(pay_amount) as pay_amount_all,sum(if(selle_ratio > 0,pay_amount * selle_ratio,0)) as income')
->where($map)
->group('game_id')
->order('game_id')
->select();
if (!empty($data)) {
foreach ($data as &$list) {
$list['income'] = bcdiv($list['income'], 100, 2);
}
}
$this->assign('withdraw', $withdraw);
$this->assign('listData', $data);
$this->assign('promoteData', $this->loginPromote);
$this->assign('meta_title', $metaTitle);
$this->assign('modelList', $modelList);
$this->display();
}
}

@ -22,7 +22,7 @@ class GameDivideController extends BaseController
//验证安全密码
$metaTitle = '分成比例';
$modelList = ['游戏管理', $metaTitle];
$this->verifyPasswordView($modelList, $metaTitle);
$this->verifyPasswordView($modelList);
$map['tab_game.online_status'] = 1;//开发者游戏上线状态
$map['tab_game.down_port'] = 1;//游戏端口 第三方接口不能申请
@ -78,6 +78,7 @@ class GameDivideController extends BaseController
$this->assign('count', $count);
$this->assign('serverType', I('server_type', 0));
$this->meta_title = $metaTitle;
$this->assign('modelList', $modelList);
$this->display();
}
}

@ -101,6 +101,10 @@ class HomeController extends Controller
public function promitionofregestion()
{
// 旧版兼容
A('Home')->landingPage();
die();
$gameData = M('Game', 'tab_')
->field('relation_game_id,sdk_version')
->where(array('id' => intval($_GET['gid'])))
@ -131,14 +135,27 @@ class HomeController extends Controller
public function landingPage()
{
$code = I('code', '');
if ($code == '') {
$this->redirect("download/downloadError", ['message' => '访问错误']);
$gameId = I('gid', 0);
$promoteId = I('pid', 0);
if ($code == '' && ($gameId == 0 || $promoteId == 0)) {
$this->error('访问错误');
}
$blackList = [];
if (in_array($code, $blackList) || in_array('gid/' . $gameId . '/pid/' . $promoteId, $blackList)) {
$this->error('该链接已被禁');
}
$applyService = new ApplyService();
$data = $applyService->decodeApplyCode($code);
$result = $applyService->checkApplyCode($data, ApplyService::ENCRYPT_TYPE_LANDING_PAGE);
if (!$result['status']) {
$this->error($result['message']);
if ($code != '') {
$applyService = new ApplyService();
$data = $applyService->decodeApplyCode($code);
$result = $applyService->checkApplyCode($data, ApplyService::ENCRYPT_TYPE_LANDING_PAGE);
if (!$result['status']) {
$this->error($result['message']);
}
$gameId = $data['game_id'];
$promoteId = $data['promote_id'];
}
$isWechat = Request::isWechat();
@ -157,7 +174,7 @@ class HomeController extends Controller
'features',
'flooring_page_imgs',
];
$map = ['id' => intval($data['game_id'])];
$map = ['id' => intval($gameId)];
$game = M('game', 'tab_')->field($columns)->where($map)->find();
@ -171,7 +188,7 @@ class HomeController extends Controller
$game = M('game', 'tab_')->field($columns)->where($map)->find();
}
$apply = M('apply', 'tab_')->field(['game_id', 'enable_status', 'promote_id'])
->where(['promote_id' => $data['promote_id'], 'game_id' => $game['id']])
->where(['promote_id' => $promoteId, 'game_id' => $game['id']])
->find();
$game['icon'] = get_cover($game['icon'], 'path');

@ -66,14 +66,14 @@ class PromoteController extends BaseController
$promote_id = get_pid();
$field = 'id,game_name,server_name,user_account,nickname,promote_account,detail,create_time as update_time';
$rz_list = M("protect_log","tab_")->field($field)->where("promote_id = {$promote_id}")->limit('0,5')->order("create_time desc")->select(); //日志管理
$rz_list = M("protect_log", "tab_")->field($field)->where("promote_id = {$promote_id}")->limit('0,5')->order("create_time desc")->select(); //日志管理
$logCount = M('protect_log','tab_')->where("promote_id = {$promote_id}")->count();
$readLogCount = M('protect_log_read','tab_')->where("promote_id = {$promote_id}")->count();
$logCount = M('protect_log', 'tab_')->where("promote_id = {$promote_id}")->count();
$readLogCount = M('protect_log_read', 'tab_')->where("promote_id = {$promote_id}")->count();
$gg_data = M("document", "sys_")->where("category_id=56 and status=1")->order("update_time desc")->select();
$gg_Count = count($gg_data);
$gg_data = implode(',',array_column($gg_data,'id'));
$gg_data = implode(',', array_column($gg_data, 'id'));
$gg_where = "promote_id = {$promote_id} and category_id=56";
if ($gg_data) {
@ -85,7 +85,7 @@ class PromoteController extends BaseController
$zx_data = M("document", "sys_")->where("category_id=51 and status=1")->order("update_time desc")->select();
$zx_Count = count($zx_data);
$zx_data = implode(',',array_column($zx_data,'id'));
$zx_data = implode(',', array_column($zx_data, 'id'));
$zx_where = "promote_id = {$promote_id} and category_id=51";
if ($zx_data) {
$zx_where .= " and document_id IN({$zx_data})";
@ -97,8 +97,8 @@ class PromoteController extends BaseController
$today_end = mktime(0, 0, 0, date('m'), date('d') + 1, date('Y')) - 1;
$today_open_server_list = M("server as sv", "tab_")
->where(
array("sv.start_time" => array("BETWEEN", array($today_start, $today_end)),
"sv.show_status" => 1))
array("sv.start_time" => array("BETWEEN", array($today_start, $today_end)),
"sv.show_status" => 1))
->join("left join tab_game gm on gm.id=sv.game_id")
->field('sv.*,gm.icon')
->order("sv.start_time desc")
@ -122,29 +122,29 @@ class PromoteController extends BaseController
//计算当日用户充值数据
$map['_string'] = "promote_id = {$promote_id} or tab_promote.parent_id = {$promote_id} or tab_promote.chain like '%/{$promote_id}/%' ";
$pay_time = " between 0 and ".time();
$spendData = $this->caculateSpend($pay_time,$map['_string']);
$pay_time = " between 0 and " . time();
$spendData = $this->caculateSpend($pay_time, $map['_string']);
$promoteId = implode(',',$promoteId);
$promoteId = implode(',', $promoteId);
if ($promoteId) {
$user_count = M("user", "tab_")->where("promote_id IN({$promoteId})")->count();
} else {
$user_count = 0;
}
$today=total(1);
$today = total(1);
$yesterdays = total(5);
$week=total(2);
$mounth=total(3);
$week = total(2);
$mounth = total(3);
//计算今日的统计数据
$data=M('User','tab_')
$data = M('User', 'tab_')
->field('promote_account,promote_id,date_format(FROM_UNIXTIME(register_time),"%Y-%m-%d") AS time, count(tab_user.id) as count,
IF(tab_promote.grand_id>0,tab_promote.grand_id,IF(tab_promote.grand_id=0 and tab_promote.parent_id >0,tab_promote.parent_id,promote_id)) as promote_id1 ,
count(IF(register_time '.$yesterdays.',1,null)) as yesterday,
count(IF(register_time '.$today.',1,null)) as today,
count(IF(register_time '.$week.',1,null)) as week,
count(IF(register_time '.$mounth.',1,null)) as mounth')
->join('tab_promote on promote_id = tab_promote.id','left')
count(IF(register_time ' . $yesterdays . ',1,null)) as yesterday,
count(IF(register_time ' . $today . ',1,null)) as today,
count(IF(register_time ' . $week . ',1,null)) as week,
count(IF(register_time ' . $mounth . ',1,null)) as mounth')
->join('tab_promote on promote_id = tab_promote.id', 'left')
->where($map)
->group('promote_id1')
->having('promote_id != 0')
@ -152,42 +152,42 @@ class PromoteController extends BaseController
->find();
// echo M('User','tab_')->_sql();die();
$total_money = $this->pay_total(0, 0,$promoteId);
$today_add_user_money = $this->pay_total(1,1,$promoteId);
$month_add_user_money = $this->pay_total(3,1,$promoteId);
$total_money = $this->pay_total(0, 0, $promoteId);
$today_add_user_money = $this->pay_total(1, 1, $promoteId);
$month_add_user_money = $this->pay_total(3, 1, $promoteId);
$yesterday_start = mktime(0, 0, 0, date('m'), date('d') - 1, date('Y'));
$yesterday_end = mktime(0, 0, 0, date('m'), date('d'), date('Y'));
//计算昨天用户的统计数据,当日用户充值数据
$pay_time = " between {$yesterday_start} and {$yesterday_end}";
$createTime = ['between',array($yesterday_start,$yesterday_end-1)];
$yesterdaySpendData = $this->caculateSpend($pay_time,$map['_string'],$createTime);
$createTime = ['between', array($yesterday_start, $yesterday_end - 1)];
$yesterdaySpendData = $this->caculateSpend($pay_time, $map['_string'], $createTime);
$todayAddSpendData = $this->caculateSpend($pay_time,$map['_string'],[],1);
$todayAddSpendData = $this->caculateSpend($pay_time, $map['_string'], [], 1);
$mounthAddSpendData = $this->caculateSpend($pay_time,$map['_string'],[],2);
$mounthAddSpendData = $this->caculateSpend($pay_time, $map['_string'], [], 2);
$yesterday_user_regist_count = M("user", "tab_")->where(
array("promote_id" => array('in',$promoteId),
array("promote_id" => array('in', $promoteId),
"register_time" => array("BETWEEN", array($yesterday_start, $yesterday_end))))
->count();
$yesterday_total_money = $this->pay_total(5, 0,$promoteId);
$yesterday_total_money = $this->pay_total(5, 0, $promoteId);
$today_start = mktime(0, 0, 0, date('m'), date('d'), date('Y'));
$today_end = mktime(0, 0, 0, date('m'), date('d') + 1, date('Y')) - 1;
$today_regist_user_count = M("user", "tab_")
->where(array("promote_id" => array('in',$promoteId),
->where(array("promote_id" => array('in', $promoteId),
"register_time" => array("BETWEEN", array($today_start, $today_end))))
->count();
$today_total_money = $this->pay_total(1, 0,$promoteId);
$today_total_money = $this->pay_total(1, 0, $promoteId);
$this->assign('data',$data);
$this->assign('data', $data);
// $this->assign('yesterdayData',$yesterdayData);
$this->assign('spendData',$spendData);
$this->assign('yesterdaySpendData',$yesterdaySpendData);
$this->assign('todayAddSpendData',$todayAddSpendData);
$this->assign('mounthAddSpendData',$mounthAddSpendData);
$this->assign('spendData', $spendData);
$this->assign('yesterdaySpendData', $yesterdaySpendData);
$this->assign('todayAddSpendData', $todayAddSpendData);
$this->assign('mounthAddSpendData', $mounthAddSpendData);
$this->assign("user_count", $user_count);
@ -202,106 +202,107 @@ class PromoteController extends BaseController
$this->assign("menu_list", $quick_menu_list);
$this->assign("gg_list", $gg_list);
$this->assign("gg_count", $gg_Count-$gg_ReadDocument);
$this->assign("gg_count", $gg_Count - $gg_ReadDocument);
$this->assign("zx_list", $zx_list);
$this->assign("zx_count", $zx_Count-$zx_ReadDocument);
$this->assign("zx_count", $zx_Count - $zx_ReadDocument);
$this->assign("xx_list", $xx_list);
$this->assign('rz_list', $rz_list);
$this->assign("rz_count", $logCount-$readLogCount);
$this->assign("rz_count", $logCount - $readLogCount);
$this->assign("today_open_server_list", $today_open_server_list);
$this->assign("game_list", $game_list);
$this->meta_title = "首页";
$this->display();
}
private function caculateSpend($pay_time,$condition,$create = [],$type = 0) {
$spend=M('Spend','tab_');
$today=total(1);
$week=total(2);
$mounth=total(3);
$map1['promote_id'] = $map['promote_id']=array('gt',0);
$map1['pay_status'] = $map['pay_status']=1;
$map1['pay_way'] = $map['pay_way'] = array('gt',0);
private function caculateSpend($pay_time, $condition, $create = [], $type = 0)
{
$spend = M('Spend', 'tab_');
$today = total(1);
$week = total(2);
$mounth = total(3);
$map1['promote_id'] = $map['promote_id'] = array('gt', 0);
$map1['pay_status'] = $map['pay_status'] = 1;
$map1['pay_way'] = $map['pay_way'] = array('gt', 0);
$userId = [];
$promoteId = M("promote", "tab_")->field('id')->where("parent_id=" . get_pid()." or grand_id=". get_pid())->select();
$promoteId = array_column($promoteId,'id');
$promoteId = implode(',',$promoteId).",".get_pid();
$whereUser['promote_id'] = ['IN',$promoteId];
$promoteId = M("promote", "tab_")->field('id')->where("parent_id=" . get_pid() . " or grand_id=" . get_pid())->select();
$promoteId = array_column($promoteId, 'id');
$promoteId = implode(',', $promoteId) . "," . get_pid();
$whereUser['promote_id'] = ['IN', $promoteId];
if ($type == 1) {
$start = mktime(0, 0, 0, date('m'), date('d'), date('Y'));
$end = mktime(0, 0, 0, date('m'), date('d') + 1, date('Y')) - 1;
$whereUser['register_time'] = ['between',array($start,$end-1)];
$userId = M('user','tab_')->field('id')->where($whereUser)->select();
$whereUser['register_time'] = ['between', array($start, $end - 1)];
$userId = M('user', 'tab_')->field('id')->where($whereUser)->select();
} else if ($type == 2) {
$start = mktime(0, 0, 0, date('m'), 1, date('Y'));
$end = mktime(0, 0, 0, date('m') + 1, 1, date('Y')) - 1;
$whereUser['register_time'] = ['between',array($start,$end-1)];
$userId = M('user','tab_')->field('id')->where($whereUser)->select();
$whereUser['register_time'] = ['between', array($start, $end - 1)];
$userId = M('user', 'tab_')->field('id')->where($whereUser)->select();
}
$userId = implode(',',array_column($userId,'id'));
$userId = implode(',', array_column($userId, 'id'));
if ($userId) {
$map1['user_id'] = $map['user_id']=['IN',$userId];
} else if (!$userId&&$type!=0) {
return array('today'=>0,'mounth'=>0);
$map1['user_id'] = $map['user_id'] = ['IN', $userId];
} else if (!$userId && $type != 0) {
return array('today' => 0, 'mounth' => 0);
}
if ($create) {
$map['create_time'] = $create;
}
$bindrecharge_data = M('bind_recharge','tab_')
$bindrecharge_data = M('bind_recharge', 'tab_')
->field('max(id) as id,promote_account,promote_id,create_time as ordertime,date_format(FROM_UNIXTIME(create_time),"%Y-%m-%d") AS time,
floor(sum(IF(create_time '.$pay_time.',real_amount,0))*100) as scount,
floor(sum(IF(create_time '.$today.',real_amount,0))*100) as today,
floor(sum(IF(create_time '.$week.',real_amount,0))*100) as week,
floor(sum(IF(create_time '.$mounth.',real_amount,0))*100) as mounth')
floor(sum(IF(create_time ' . $pay_time . ',real_amount,0))*100) as scount,
floor(sum(IF(create_time ' . $today . ',real_amount,0))*100) as today,
floor(sum(IF(create_time ' . $week . ',real_amount,0))*100) as week,
floor(sum(IF(create_time ' . $mounth . ',real_amount,0))*100) as mounth')
->where($map1)
->group('promote_id')
->select(false);
$deposit_data = M('deposit','tab_')
$deposit_data = M('deposit', 'tab_')
->field('max(id) as id,promote_account,promote_id,create_time as ordertime,date_format(FROM_UNIXTIME(create_time),"%Y-%m-%d") AS time,
floor(sum(IF(create_time '.$pay_time.',pay_amount,0))*100) as scount,
floor(sum(IF(create_time '.$today.',pay_amount,0))*100) as today,
floor(sum(IF(create_time '.$week.',pay_amount,0))*100) as week,
floor(sum(IF(create_time '.$mounth.',pay_amount,0))*100) as mounth')
floor(sum(IF(create_time ' . $pay_time . ',pay_amount,0))*100) as scount,
floor(sum(IF(create_time ' . $today . ',pay_amount,0))*100) as today,
floor(sum(IF(create_time ' . $week . ',pay_amount,0))*100) as week,
floor(sum(IF(create_time ' . $mounth . ',pay_amount,0))*100) as mounth')
// ->join('tab_user on tab_user.id = tab_spend.user_id','left')
->where($map1)
->group('promote_id')
->select(false);
$spendData=$spend
$spendData = $spend
->field('max(id) as id,promote_account,promote_id,pay_time as ordertime,date_format(FROM_UNIXTIME(pay_time),"%Y-%m-%d") AS time,
floor(sum(IF(pay_time '.$pay_time.',pay_amount,0))*100) as scount,
floor(sum(IF(pay_time '.$today.',pay_amount,0))*100) as today,
floor(sum(IF(pay_time '.$week.',pay_amount,0))*100) as week,
floor(sum(IF(pay_time '.$mounth.',pay_amount,0))*100) as mounth')
floor(sum(IF(pay_time ' . $pay_time . ',pay_amount,0))*100) as scount,
floor(sum(IF(pay_time ' . $today . ',pay_amount,0))*100) as today,
floor(sum(IF(pay_time ' . $week . ',pay_amount,0))*100) as week,
floor(sum(IF(pay_time ' . $mounth . ',pay_amount,0))*100) as mounth')
// ->join('tab_user on tab_user.id = tab_spend.user_id','left')
->where($map)
->union(' ('.$bindrecharge_data.') ')
->union(' ('.$deposit_data.') ')
->union(' (' . $bindrecharge_data . ') ')
->union(' (' . $deposit_data . ') ')
->group('promote_id')
->select(false);
$spendData = $spend->field('a.promote_account,a.promote_id,a.time,sum(a.scount) as count,sum(a.today) as today,sum(a.week) as week,sum(a.mounth) as mounth,IF(tab_promote.grand_id>0,tab_promote.grand_id,IF(tab_promote.grand_id=0 and tab_promote.parent_id >0,tab_promote.parent_id,promote_id)) as promote_id1')
->join('tab_promote on promote_id = tab_promote.id','left')
->join('tab_promote on promote_id = tab_promote.id', 'left')
->where($condition)
->table('('.$spendData.') as a')->group('promote_id1')->order('count desc,a.ordertime')->find();
$spendData['rand']=1;
$spendData['count']=$spendData['count']/100;
$spendData['today']=$spendData['today']/100;
$spendData['week']=$spendData['week']/100;
$spendData['mounth']=$spendData['mounth']/100;
->table('(' . $spendData . ') as a')->group('promote_id1')->order('count desc,a.ordertime')->find();
$spendData['rand'] = 1;
$spendData['count'] = $spendData['count'] / 100;
$spendData['today'] = $spendData['today'] / 100;
$spendData['week'] = $spendData['week'] / 100;
$spendData['mounth'] = $spendData['mounth'] / 100;
return $spendData;
}
private function pay_total($type = 0, $newadd = 1,$promoteId="")
private function pay_total($type = 0, $newadd = 1, $promoteId = "")
{
if ($_REQUEST['promote_id'] === null || $_REQUEST['promote_id'] === '0') {
$map['parent_id'] = get_pid();
@ -482,7 +483,7 @@ class PromoteController extends BaseController
} else {
$menuData = M("promote_quick_menu ", "tab_")->where(array("promote_id" => get_pid()))->count();
if ($menuData>=10) {
if ($menuData >= 10) {
$this->ajaxReturn(['status' => 1, 'info' => '快捷菜单只能有10个'], "JSON");
}
M("promote_quick_menu ", "tab_")->add(
@ -524,12 +525,12 @@ class PromoteController extends BaseController
$count = M("document", "sys_")->where("category_id=56 and status=1")->count();
}
$promote_id = get_pid();
$logCount = M('protect_log','tab_')->count();
$readLogCount = M('protect_log_read','tab_')->where("promote_id = {$promote_id}")->count();
$logCount = M('protect_log', 'tab_')->count();
$readLogCount = M('protect_log_read', 'tab_')->where("promote_id = {$promote_id}")->count();
$gg_data = M("document", "sys_")->where("category_id=56 and status=1")->order("update_time desc")->select();
$gg_Count = count($gg_data);
$gg_data = implode(',',array_column($gg_data,'id'));
$gg_data = implode(',', array_column($gg_data, 'id'));
$gg_where = "promote_id = {$promote_id} and category_id=56";
if ($gg_data) {
@ -541,7 +542,7 @@ class PromoteController extends BaseController
$zx_data = M("document", "sys_")->where("category_id=51 and status=1")->order("update_time desc")->select();
$zx_Count = count($zx_data);
$zx_data = implode(',',array_column($zx_data,'id'));
$zx_data = implode(',', array_column($zx_data, 'id'));
$zx_where = "promote_id = {$promote_id} and category_id=51";
if ($zx_data) {
$zx_where .= " and document_id IN({$zx_data})";
@ -558,9 +559,9 @@ class PromoteController extends BaseController
$this->meta_title = "公告列表";
$this->assign("type", $type);
$this->assign("data_list", $data_list);
$this->assign("gg_count", $gg_Count-$gg_ReadDocument);
$this->assign("zx_count", $zx_Count-$zx_ReadDocument);
$this->assign("rz_count", $logCount-$readLogCount);
$this->assign("gg_count", $gg_Count - $gg_ReadDocument);
$this->assign("zx_count", $zx_Count - $zx_ReadDocument);
$this->assign("rz_count", $logCount - $readLogCount);
$this->display();
}
@ -837,7 +838,7 @@ class PromoteController extends BaseController
$map = [];
$map['chain'] = ['like', $loginer['chain'] . $loginer['id'] . '/%'];
if ($promoteType == 0) {
$map['level'] = 2;
} elseif ($promoteType == 1) {
@ -863,7 +864,7 @@ class PromoteController extends BaseController
}
$query = M('promote', 'tab_')->where($map);
list($records, $pagination, $count) = $this->paginate($query);
$ids = array_column($records, 'id');
$countList = [];
@ -917,7 +918,7 @@ class PromoteController extends BaseController
}
$status = $promoteService->addPromote($params, $parent);
if ($status) {
$this->ajaxReturn(['status' => 1, 'msg' => '添加成功']);
$this->ajaxReturn(['status' => 1, 'msg' => '添加成功']);
} else {
$this->ajaxReturn(['status' => 0, 'msg' => '添加失败']);
}
@ -926,7 +927,7 @@ class PromoteController extends BaseController
$loginer = $this->getLoginPromote();
$promotes = null;
$promoteColumns = ['id', 'account', 'real_name'];
$promoteMap = ['chain' => ['like', $loginer['chain'] . $loginer['id'] . '/' . '%']];
$promoteMap = ['chain' => ['like', $loginer['chain'] . $loginer['id'] . '/' . '%']];
if ($loginer['level'] == 1) {
if ($promoteType == 1) {
$promoteMap['level'] = 2;
@ -1070,7 +1071,7 @@ class PromoteController extends BaseController
$res = $user->edit($_POST);
if ($res !== false) {
$this->success("子账号修改成功", U('Promote/mychlid'));
$this->success("子账号修改成功", U('Promote/children'));
} else {
$this->error("修改子账号失败");
}
@ -1857,9 +1858,15 @@ class PromoteController extends BaseController
//验证安全密码
$metaTitle = '设置';
$modelList = ['游戏管理', $metaTitle];
$this->verifyPasswordView($modelList, $metaTitle);
$res = $this->verifyPasswordView($modelList, ($_POST ? false : true));
if ($_POST) {
if ($res === false) {
$data['status'] = 0;
$data['msg'] = '权限异常';
$this->ajaxReturn($data);
}
$save['child_game_permission'] = I('post.child_game_permission');
$saveRes = D('Promote')->where(array('id' => PID))->save($save);
if ($saveRes === false) {
@ -1877,6 +1884,7 @@ class PromoteController extends BaseController
$this->assign('data', $promoteData);
$this->meta_title = $metaTitle;
$this->assign('modelList', $modelList);
$this->display();
}
}

@ -1811,11 +1811,8 @@ class QueryController extends BaseController
$allRecords[$recharge['game_player_id']] = $recharge;
}
$map['pay_time'] = ['between', [strtotime(date('Y-m-d 00:00:00')), strtotime(date('Y-m-d 23:59:59'))]];
if (isset($map['_string'])) {
unset($map['_string']);
}
$todayRecharges = M('spend', 'tab_')->field('sum(cost) cost, game_player_id')->where($map)->group('game_player_id')->select();
$spendMap['pay_time'] = ['between', [strtotime(date('Y-m-d 00:00:00')), strtotime(date('Y-m-d 23:59:59'))]];
$todayRecharges = M('spend', 'tab_')->field('sum(cost) cost, game_player_id')->where($spendMap)->group('game_player_id')->select();
$todayRecords = [];
foreach ($todayRecharges as $recharge) {
$todayRecords[$recharge['game_player_id']] = $recharge;

@ -88,8 +88,8 @@ class MemberModel extends Model{
'last_login_time' => $user['last_login_time'],
);
session('user_auth', $auth);
session('user_auth_sign', data_auth_sign($auth));
session(['name'=>'user_auth', 'expire'=>60*60], $auth);
session(['name'=>'user_auth_sign', 'expire'=>60*60], data_auth_sign($auth));
}

@ -108,7 +108,7 @@ class PromoteModel extends Model{
}
public function get_child_promote($pid,$field=true) {
public function get_child_promote($pid, $field=true) {
$map['parent_id'] = $pid;
$map['grand_id'] = $pid;
$map['_logic'] = 'or';

@ -0,0 +1,184 @@
<extend name="Public/promote_base"/>
<block name="css">
<link href="__CSS__/index/index.new.css" rel="stylesheet" >
<style>
.form-group {
display: flex;
}
.form-group label {
line-height: 34px;
height: 34px;
}
.form-group .txt {
width: 120px;
height: 34px;
color: #515974;
}
.withdraw {
width: 200px;
height: 2.4rem;
border: 0;
border-radius: 5px;
color: #fff;
background-color: #358fe4;
cursor: pointer;
}
</style>
</block>
<block name="body">
<div class="page-overview promote-index-overview index-overview clearfix poll">
<ul>
<li><div class="icon"><span class="placeholder-graphic"><img src="__IMG__/20180207/icon_chongzhi1.png"/></span></div> <div class="text text2"><p>历史收益</p><span>¥{$income.history_income}</span></div> </li>
<li><div class="icon"><span class="placeholder-graphic"><img src="__IMG__/20180207/icon_chongzhi2.png"/></span></div> <div class="text text1"><p>本月收益</p><span>¥{$income.this_month_income}</span></div> </li>
<li><div class="icon"><span class="placeholder-graphic"><img src="__IMG__/20180207/icon_chongzhi3.png"/></span></div> <div class="text text3"><p>昨日收益</p><span>¥{$income.yesterday_income}</span></div> </li>
<li><div class="icon"><span class="placeholder-graphic"><img src="__IMG__/20180207/icon_chongzhi5.png"/></span></div> <div class="text text5"><p>账户余额</p><span>¥{$income.balance}</span></div> </li>
</ul>
</div>
<div style="margin-top: 2.4vh;">
<button class="withdraw" id="withdraw">提现</button>
</div>
<div class="page-list promote-index-list promote-index-list-news">
<div class="trunk-title-main"><span>{$meta_title}</span></div>
<div class="trunk-content article">
<div class="trunk-search clearfix jssearch">
<div class="form-group fl">
<label class="form-title select-title" style="position: relative;">时间:</label>
<div class="select-time">
<input type="text" readonly id="sdate" class="txt" name="begtime" placeholder="" value="{$initBegTime}">
</div>
<label class="form-title select-title zhi_color">&nbsp;&nbsp;&nbsp;&nbsp;</label>
<div class="select-time">
<input type="text" readonly id="edate" class="txt" name="endtime" placeholder="" value="{$initEndTime}">
</div>
</div>
<div class="form-group normal_space fl">
<input type="submit" class="submit" id='submit' url="{:U('Finance/index','model='.$model['name'],false)}"
value="查询">
</div>
</div>
<div class="trunk-list list_normal">
<table class="table normal_table">
<tr class="odd">
<th>时间</th>
<th>收益</th>
<th>操作</th>
</tr>
<empty name="listData">
<tr><td colspan="3" style="text-align: center;height: 38vh;"><img src="__IMG__/20180207/icon_wushujv2.png"/><p style="line-height: 40px;color: #A5A5A5;">暂无数据</p></td></tr>
<else />
<volist name="listData" id="data">
<tr>
<td>{$data.day}</td>
<td>{$data.income}</td>
<td><a href="{$data.url}">明细</a></td>
</tr>
</volist>
</empty>
</table>
</div>
<div class="pagenation clearfix">
{$_page}
</div>
</div>
</div>
<link href="__STATIC__/datetimepicker/css/datetimepicker.css" rel="stylesheet" type="text/css">
<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 type="text/javascript" src="__JS__/index/jquery.fxTab.js"></script>
<script type="text/javascript" src="__JS__/20170831/select2.min.js"></script>
<script>
$(function(){
var date = "";
$('#sdate').datetimepicker({
format: 'yyyy-mm-dd',
language: "zh-CN",
minView: 2,
autoclose: true,
scrollMonth: false,
scrollTime: false,
scrollInput: false,
endDate: date
});
$('#edate').datetimepicker({
format: 'yyyy-mm-dd',
language: "zh-CN",
minView: 2,
autoclose: true,
pickerPosition: 'bottom-left',
scrollMonth: false,
scrollTime: false,
scrollInput: false,
endDate: date
});
$('#submit').click(function () {
var sdate = Date.parse($('#sdate').val()) / 1000;
var edate = Date.parse($('#edate').val()) / 1000;
if (sdate > edate) {
layer.msg('开始时间必须小于等于结束时间', {icon: 5});
return false;
}
if ((edate - sdate) > 2505600) {
layer.msg('时间间隔不能超过30天请重新选择日期', {icon: 5});
return false;
}
var url = $(this).attr('url');
console.log(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;
});
$('#withdraw').click(function () {
var balance = parseFloat("{$income.balance}");
if (balance < 100) {
layer.msg('账户余额低于100元无法提现', {icon: 5});
return false;
}
var msg = "收益结算截止时间:{$yesterday}";
msg += "<br>";
msg += "提现金额:{$income.balance}元";
layer.confirm(msg, {
title: '信息',
btn: ['提交', '取消'],
}, function () {
$.ajax({
type: 'post',
url: '{:U("withdraw")}',
dataType: 'json',
data: {},
success: function (data) {
if (data.status == 1) {
layer.msg(data.msg, {icon: 1});
setTimeout(function(){
window.location.reload();
},2000);
} else {
layer.msg(data.msg, {icon: 5});
}
},
error: function (result) {
layer.msg('网络异常', {icon: 5});
}
});
});
});
$(".select_gallery").select2();
});
</script>
</block>

@ -66,7 +66,15 @@
<div class="page-search normal_list query-recharge-search jssearch">
<div class="trunk-title">
<div class="location">
<div class="location-container">当前位置:<span>财务管理></span><span>{$meta_title}</span></div>
<div class="location-container">当前位置:
<volist name="modelList" id="vo" key="k">
<?php if ($k == count($modelList)) {
echo "<span>$vo</span>";
} else {
echo "<span>$vo></span>";
}?>
</volist>
</div>
</div>
<img src="__IMG__/20180207/icon_chongzhi.png">
<span class="title_main">{$meta_title}</span>
@ -77,7 +85,7 @@
</div>
<!-- <form action="{:U('Finance/settlementDtl')}" method="get" enctype="multipart/form-data" class="normal_form"> -->
<div class="form-group normal_space" style="margin-left: 0;">
<input type="text" name="pay_order_number" class="txt normal_txt" placeholder="请输入游戏订单号"
<input type="text" name="pay_order_number" class="txt normal_txt" placeholder="游戏订单号"
value="{:I('pay_order_number','')}">
</div>

@ -0,0 +1,200 @@
<extend name="Public/promote_base"/>
<block name="css">
<link href="__CSS__/20180207/platform.css" rel="stylesheet">
<link href="__CSS__/detailed.css" rel="stylesheet">
<link href="__STATIC__/icons_alibaba/iconfont.css" rel="stylesheet">
<style>
.trunk-list .table3 {
width: 100%;
}
.table3 tr td {
border: 1px solid #E0E7EF;
}
.pagenation {
line-height: 6.5vh;
}
.pagenation > div {
text-align: right;
}
.trunk-list .table3 tr {
height: 4.2vh;
}
.detailed-content-box {
width: 350px;
}
</style>
</block>
<block name="body">
<div class="page-search normal_list charge-agentPay-search">
<div style="position: absolute;margin-top: -25px;color: #6a7082;">
<span class="back-btn" style="cursor: pointer;"><i class="iconfont iconreply"></i> 返回</span>
</div>
<div class="trunk-title">
<div class="location">
<div class="location-container">当前位置:
<volist name="modelList" id="vo" key="k">
<?php if ($k == count($modelList)) {
echo "<span>$vo</span>";
} else {
echo "<span>$vo></span>";
}?>
</volist>
</div>
</div>
<span class="title_main">订单信息</span>
</div>
<div class="trunk-content article">
<div class="trunk-search clearfix" style="display: grid;">
<div class="tab detailed-box">
<label class="detailed-title detailed-label">提现订单号:</label>
<div class="detailed-content-box">
<span>{$withdraw.widthdraw_number}</span>
</div>
<label class="detailed-title detailed-label">申请时间:</label>
<div class="detailed-content-box">
<span>{$withdraw.create_time}</span>
</div>
</div>
<div class="tab detailed-box">
<label class="detailed-title detailed-label">会长账号:</label>
<div class="detailed-content-box">
<span>{$withdraw.promote_account}</span>
</div>
<label class="detailed-title detailed-label">结算截止时间:</label>
<div class="detailed-content-box">
<span>{$withdraw.settlement_end_time}</span>
</div>
</div>
<div class="tab detailed-box">
<label class="detailed-title detailed-label">状态:</label>
<div class="detailed-content-box">
<span>{$withdraw.status}</span>
</div>
<label class="detailed-title detailed-label">收款人:</label>
<div class="detailed-content-box">
<span>{$promoteData.bank_account}</span>
</div>
</div>
<div class="tab detailed-box">
<label class="detailed-title detailed-label">开户行:</label>
<div class="detailed-content-box">
<span>{$promoteData.bank_name}</span>
</div>
<label class="detailed-title detailed-label">银行账号:</label>
<div class="detailed-content-box">
<span>{$promoteData.bank_card}</span>
</div>
</div>
<div class="tab detailed-box">
<label class="detailed-title detailed-label">收益金额:</label>
<div class="detailed-content-box">
<span>
<if condition="$withdraw.status eq -1">
0.00
<else/>
{$withdraw.sum_money}
</if>
</span>
</div>
</div>
<div class="tab detailed-box">
<label class="detailed-title detailed-label">奖惩金额:</label>
<div class="detailed-content-box">
<span>0.00</span>
</div>
</div>
<div class="tab detailed-box">
<label class="detailed-title detailed-label">实际提现金额:</label>
<div class="detailed-content-box">
<span>
<if condition="$withdraw.status eq -1">
0.00
<else/>
{$withdraw.sum_money}
</if>
<span style="color: red;">(实际提现金额=提现金额+奖惩金额)</span>
</span>
</div>
</div>
</div>
</div>
<div class="trunk-title">
<span class="title_main">结算汇总</span>
</div>
<div class="trunk-content article">
<div class="tabcon trunk-list">
<table class="table normal_table">
<tr class="odd">
<th>游戏名称</th>
<th>流水</th>
<th>现金分成基数</th>
<th>现金分成比例</th>
<th>平台币分成基数</th>
<th>平台币分成比例</th>
<th>绑定币分成基数</th>
<th>绑定币分成比例</th>
<th>合作方分成金额</th>
</tr>
<if condition="true eq empty($listData) or $withdraw.status eq -1">
<tr class="num2">
<td colspan="99" style="text-align: center;height: 45vh;">
<img src="__IMG__/20180207/icon_wushujv2.png"/>
<p style="line-height: 40px;color: #A5A5A5;">暂无数据</p>
</td>
</tr>
<else/>
<volist name="listData" id="vo">
<tr class="num2">
<td>{$vo.game_name}</td>
<td>{$vo.pay_amount_all}</td>
<if condition="$vo.pay_way neq -1 and $vo.pay_way neq 0">
<td>{$vo.pay_amount_all}</td>
<else/>
<td>0</td>
</if>
<td>{$vo.selle_ratio}%</td>
<if condition="$vo.pay_way eq 0">
<td>{$vo.pay_amount_all}</td>
<else/>
<td>0</td>
</if>
<td>{$vo.selle_ratio}%</td>
<if condition="$vo.pay_way eq -1">
<td>{$vo.pay_amount_all}</td>
<else/>
<td>0</td>
</if>
<td>{$vo.selle_ratio}%</td>
<td>{$vo.income}</td>
</tr>
</volist>
</if>
</table>
</div>
</div>
<div class="detailed-br"></div>
</div>
</block>
<block name="script">
<script type="text/javascript" src="__STATIC__/layer/extend/layer.ext.js"></script>
<script type="text/javascript" src="__JS__/20170831/select2.min.js"></script>
<script type="text/javascript">
$('.back-btn').on('click', function () {
location.href = "{:U('withdrawRecord')}";
});
</script>
</block>

@ -0,0 +1,236 @@
<extend name="Public/promote_base"/>
<block name="css">
<link href="__CSS__/20180207/data.css" rel="stylesheet">
<link href="__CSS__/20180207/manager.css" rel="stylesheet">
<link href="__CSS__/20180207/finance.css" rel="stylesheet">
<link href="__CSS__/game_detailed.css" rel="stylesheet">
<link href="__STATIC__/icons_alibaba/iconfont.css?v=1.2" rel="stylesheet">
</block>
<block name="body">
<style>
@media screen and (max-width: 1500px) {
.normal_form {
padding-top: 45px;
}
.trunk-search .normal_txt {
width: 100px
}
.select2-container--default .select2-selection--single {
width: 125px;
}
.trunk-search .select-time .txt {
width: 100px;
}
.form-group .submit {
width: 55px;
}
}
.selected-color {
color: #2bd8ed;
}
.pointer-hand {
cursor: pointer;
}
.icon-spend {
position: relative;
font-size: 1.2rem;
top: 3px;
float: right;
right: 10px;
}
.th-hide {
display: none;
}
.form-group {
float: left;
margin-bottom: 10px;
}
.form-group label {
line-height: 34px;
height: 34px;
}
.form-group .txt {
width: 180px;
height: 34px;
}
.trunk-search {
padding-bottom: 10px;
}
.btn-role-border {
border-left: 0;
}
.normal_table tr td a {
cursor: pointer;
}
</style>
<div class="page-search normal_list query-recharge-search">
<div style="position: absolute;margin-top: -25px;color: #6a7082;">
<span class="back-btn" style="cursor: pointer;"><i class="iconfont iconreply"></i> 返回</span>
</div>
<div class="trunk-title">
<div class="location">
<div class="location-container">当前位置:
<volist name="modelList" id="vo" key="k">
<?php if ($k == count($modelList)) {
echo "<span>$vo</span>";
} else {
echo "<span>$vo></span>";
}?>
</volist>
</div>
</div>
<img src="__IMG__/20180207/icon_chongzhi.png">
<span class="title_main">{$meta_title}</span>
</div>
<div class="trunk-content article">
<div class="trunk-search clearfix jssearch">
<!-- <form action="{:U('Finance/settlementDtl')}" method="get" enctype="multipart/form-data" class="normal_form"> -->
<div class="form-group normal_space" style="margin-left: 0;">
<label>游戏名称:</label>
<select id="game_id" name="game_id" class="reselect select_gallery" style="min-width:200px;width: 175px;">
<option value="">全部</option>
<volist name=":getPromoteSearchGame()" id="vo">
<option value="{$vo.id}" title="{$vo.game_name}"
<if condition="I('game_id') eq $vo['id']">selected</if>
>{$vo.game_name} </option>
</volist>
</select>
</div>
<div class="form-group normal_space">
<input type="text" name="user_account" class="txt normal_txt" placeholder="玩家账号"
value="{:I('user_account','')}">
</div>
<div class="form-group normal_space">
<input type="text" name="pay_order_number" class="txt normal_txt" placeholder="充值订单号"
value="{:I('pay_order_number','')}">
</div>
<div class="form-group normal_space">
<input type="hidden" name="id" value="{:I('get.id')}">
<input type="submit" class="submit" id='submit' url="{:U('Finance/withdrawDtl','model='.$model['name'],false)}"
value="查询">
</div>
<!-- </form> -->
</div>
<div class="page-list apply-app_apply-list query-recharge-list">
<div class="trunk-content article" style="margin-left: 0;margin-right: 0;">
<div class="tabcon trunk-list">
<table class="table normal_table">
<tr class="odd">
<th>充值订单号</th>
<th>游戏</th>
<th>平台</th>
<th>玩家账号</th>
<th>订单总额</th>
<th>现金分成基数</th>
<th>现金分成比例</th>
<th>平台币分成基数</th>
<th>平台币分成比例</th>
<th>绑定币分成基数</th>
<th>绑定币分成比例</th>
<th>现金支付通道</th>
<th>收益</th>
<th>订单状态</th>
<th>充值时间</th>
</tr>
<empty name="listData">
<tr class="num2">
<td colspan="99" style="text-align: center;height: 45vh;">
<img src="__IMG__/20180207/icon_wushujv2.png"/>
<p style="line-height: 40px;color: #A5A5A5;">暂无数据</p>
</td>
</tr>
<else/>
<volist name="listData" id="vo">
<tr class="num2">
<td>{$vo.pay_order_number}</td>
<td>{$vo.game_name}</td>
<td>{:getSDKTypeName($vo['sdk_version'])}</td>
<td>{$vo.user_account}</td>
<td>{$vo.pay_amount}</td>
<if condition="$vo.pay_way neq -1 and $vo.pay_way neq 0">
<td>{$vo.pay_amount}</td>
<else/>
<td>0</td>
</if>
<td>{$vo.selle_ratio}%</td>
<if condition="$vo.pay_way eq 0">
<td>{$vo.pay_amount}</td>
<else/>
<td>0</td>
</if>
<td>{$vo.selle_ratio}%</td>
<if condition="$vo.pay_way eq -1">
<td>{$vo.pay_amount}</td>
<else/>
<td>0</td>
</if>
<td>{$vo.selle_ratio}%</td>
<td>{$vo.pay_way_name}</td>
<td>{$vo.income}</td>
<td>{$status}</td>
<td>{$vo.pay_time}</td>
</tr>
</volist>
</empty>
</table>
</div>
<div class="pagenation clearfix">
{$_page}
</div>
</div>
</div>
</div>
</div>
</block>
<block name="script">
<link href="__STATIC__/datetimepicker/css/datetimepicker.css" rel="stylesheet" type="text/css">
<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 type="text/javascript" src="__JS__/20170831/select2.min.js"></script>
<script src="__STATIC__/layer/layer.js"></script>
<script type="text/javascript" src="__JS__/common.js"></script>
<script type="text/javascript">
$().ready(function () {
$('.back-btn').on('click', function () {
location.href = "{:U('withdrawRecord')}";
});
$('#submit').click(function () {
var url = $(this).attr('url');
console.log(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;
});
$(".select_gallery").select2();
});
</script>
</block>

@ -0,0 +1,267 @@
<extend name="Public/promote_base"/>
<block name="css">
<link href="__CSS__/20180207/data.css" rel="stylesheet">
<link href="__CSS__/20180207/manager.css" rel="stylesheet">
<link href="__CSS__/20180207/finance.css" rel="stylesheet">
<link href="__CSS__/game_detailed.css" rel="stylesheet">
<link href="__STATIC__/icons_alibaba/iconfont.css?v=1.2" rel="stylesheet">
</block>
<block name="body">
<style>
@media screen and (max-width: 1500px) {
.normal_form {
padding-top: 45px;
}
.trunk-search .normal_txt {
width: 100px
}
.select2-container--default .select2-selection--single {
width: 125px;
}
.trunk-search .select-time .txt {
width: 100px;
}
.form-group .submit {
width: 55px;
}
}
.selected-color {
color: #2bd8ed;
}
.pointer-hand {
cursor: pointer;
}
.icon-spend {
position: relative;
font-size: 1.2rem;
top: 3px;
float: right;
right: 10px;
}
.th-hide {
display: none;
}
.form-group {
float: left;
margin-bottom: 10px;
}
.form-group label {
line-height: 34px;
height: 34px;
}
.form-group .txt {
width: 180px;
height: 34px;
}
.trunk-search {
padding-bottom: 10px;
}
.btn-role-border {
border-left: 0;
}
.normal_table tr td a {
cursor: pointer;
}
</style>
<div class="page-search normal_list query-recharge-search">
<div class="trunk-title">
<div class="location">
<div class="location-container">当前位置:
<volist name="modelList" id="vo" key="k">
<?php if ($k == count($modelList)) {
echo "<span>$vo</span>";
} else {
echo "<span>$vo></span>";
}?>
</volist>
</div>
</div>
<img src="__IMG__/20180207/icon_chongzhi.png">
<span class="title_main">{$meta_title}</span>
</div>
<div class="trunk-content article">
<div class="trunk-search clearfix jssearch">
<!-- <form action="{:U('Finance/settlementDtl')}" method="get" enctype="multipart/form-data" class="normal_form"> -->
<div class="form-group normal_space" style="margin-left: 0;">
<input type="text" name="widthdraw_number" class="txt normal_txt" placeholder="提现订单号"
value="{:I('widthdraw_number','')}">
</div>
<div class="form-group normal_space">
<label class="form-title select-title" style="position: relative;">交易时间:</label>
<div class="select-time">
<input type="text" id="sdate" class="txt" name="begtime" placeholder="开始时间" value="{$initBegTime}">
</div>
<label class="form-title select-title zhi_color">&nbsp;&nbsp;</label>
<div class="select-time">
<input type="text" id="edate" class="txt" name="endtime" placeholder="结束时间" value="{$initEndTime}">
</div>
</div>
<div class="form-group normal_space">
<input type="hidden" name="status" id="status" value="{$status}">
<input type="submit" class="submit" id='submit' url="{:U('Finance/withdrawRecord','model='.$model['name'],false)}"
value="查询">
</div>
<!-- </form> -->
</div>
<div class="tab marg_top20" style="margin-bottom: 20px;">
<div style="display: flex;">
<div class="btn btn-role <if condition='$status heq ""'>highlight</if>" status="">
<p>全部</p>
</div>
<div class="btn btn-role btn-role-border <if condition='$status heq 0'>highlight</if>" status="0">
<p>待审核</p>
</div>
<div class="btn btn-role btn-role-border <if condition='$status eq -1'>highlight</if>" status="-1">
<p>审核未通过</p>
</div>
<div class="btn btn-role btn-role-border <if condition='$status eq 1'>highlight</if>" status="1">
<p>汇款中</p>
</div>
<div class="btn btn-role btn-role-border <if condition='$status eq 2'>highlight</if>" status="2">
<p>已汇款</p>
</div>
</div>
</div>
<div class="page-list apply-app_apply-list query-recharge-list">
<div class="trunk-content article" style="margin-left: 0;margin-right: 0;">
<div class="tabcon trunk-list">
<table class="table normal_table">
<tr class="odd">
<th>提现订单</th>
<th>提现日期</th>
<th>结算截止日期</th>
<th>收益金额</th>
<th>实际提现金额</th>
<th>提现状态</th>
<th>说明</th>
<th>操作</th>
</tr>
<empty name="listData">
<tr class="num2">
<td colspan="99" style="text-align: center;height: 45vh;">
<img src="__IMG__/20180207/icon_wushujv2.png"/>
<p style="line-height: 40px;color: #A5A5A5;">暂无数据</p>
</td>
</tr>
<else/>
<volist name="listData" id="vo">
<tr class="num2">
<td>{$vo.widthdraw_number}</td>
<td>{$vo.create_time}</td>
<td>{$vo.settlement_end_time}</td>
<td>{$vo.sum_money}</td>
<td>{$vo.sum_money}</td>
<td>{$vo.status}</td>
<td>{$vo.respond}</td>
<td>
<a href="{:U('withdrawDtl', array('id'=>$vo['id']))}">提现明细</a>
<a>汇款证明</a>
<a href="{:U('settlementOrder', array('id'=>$vo['id']))}">结算单</a>
</td>
</tr>
</volist>
</empty>
</table>
</div>
<div class="pagenation clearfix">
{$_page}
</div>
</div>
</div>
</div>
</div>
</block>
<block name="script">
<link href="__STATIC__/datetimepicker/css/datetimepicker.css" rel="stylesheet" type="text/css">
<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 type="text/javascript" src="__JS__/20170831/select2.min.js"></script>
<script src="__STATIC__/layer/layer.js"></script>
<script type="text/javascript" src="__JS__/common.js"></script>
<script type="text/javascript">
$().ready(function () {
var date = "{$setdate}";
$('#sdate').datetimepicker({
format: 'yyyy-mm-dd',
language: "zh-CN",
minView: 2,
autoclose: true,
scrollMonth: false,
scrollTime: false,
scrollInput: false,
endDate: date
});
$('#edate').datetimepicker({
format: 'yyyy-mm-dd',
language: "zh-CN",
minView: 2,
autoclose: true,
pickerPosition: 'bottom-left',
scrollMonth: false,
scrollTime: false,
scrollInput: false,
endDate: date
});
$('.btn-role').on('click', function () {
var thisElement = $(this);
if (!thisElement.hasClass('highlight')) {
var status = thisElement.attr('status');
$('#status').val(status);
$('.btn-role').removeClass('highlight');
thisElement.addClass('highlight');
$('#submit').trigger('click');
}
});
$('#submit').click(function () {
var sdate = $('#sdate').val();
var edate = $('#edate').val();
if (Date.parse(sdate) > Date.parse(edate)) {
layer.msg('开始时间必须小于等于结束时间');
return false;
}
var url = $(this).attr('url');
console.log(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;
});
$(".select_gallery").select2();
});
</script>
</block>

@ -111,7 +111,15 @@
<div class="page-list normal_list apply-index-list jssearch">
<div class="trunk-title">
<div class="location">
<div class="location-container">当前位置:<span>游戏管理></span><span>{$meta_title}</span></div>
<div class="location-container">当前位置:
<volist name="modelList" id="vo" key="k">
<?php if ($k == count($modelList)) {
echo "<span>$vo</span>";
} else {
echo "<span>$vo></span>";
}?>
</volist>
</div>
</div>
<img src="__IMG__/20180207/icon_normal_game.png"><span class="title_main">{$meta_title}</span>
</div>

@ -27,7 +27,15 @@
<div class="page-list normal_list apply-index-list">
<div class="trunk-title">
<div class="location">
<div class="location-container">当前位置:<span>游戏管理></span><span>{$meta_title}</span></div>
<div class="location-container">当前位置:
<volist name="modelList" id="vo" key="k">
<?php if ($k == count($modelList)) {
echo "<span>$vo</span>";
} else {
echo "<span>$vo></span>";
}?>
</volist>
</div>
</div>
<img src="__IMG__/20180207/icon_normal_game.png"><span class="title_main">{$meta_title}</span>
</div>

@ -69,15 +69,14 @@
</div>
<?php endif;?>
<?php if ($loginer['level'] == 1) :?>
<div class="subNav jssubNav"><i class="prev_icon icon_caiwu"></i><span>财务管理</span><i class="arrow_icon"></i></div>
<div class="navContent jsnavContent">
<a href="{:U('Finance/settlementDtl')}" class="<if condition='CONTROLLER_NAME eq Finance and ACTION_NAME eq settlementDtl '>active</if> ">结算明细</a>
<lt name="Think.const.PRO_GRADE" value="3">
<a href="{:U('Query/son_earning')}" class="<if condition='CONTROLLER_NAME eq Query and (ACTION_NAME eq son_earning or ACTION_NAME eq son_list)'>active</if> ">子渠道结算</a>
</lt>
<a href="{:U('Finance/index')}" class="<if condition='CONTROLLER_NAME eq Finance and ACTION_NAME eq index '>active</if> ">结算中心</a>
<a href="{:U('Finance/settlementDtl')}" class="<if condition='CONTROLLER_NAME eq Finance and ACTION_NAME eq settlementDtl '>active</if> ">结算明细</a>
<a href="{:U('Finance/withdrawRecord')}" class="<if condition='CONTROLLER_NAME eq Finance and (ACTION_NAME eq withdrawRecord or ACTION_NAME eq withdrawDtl) '>active</if> ">提现记录</a>
</div>
<?php endif ;?>
<div class="subNav jssubNav"><i class="prev_icon icon_fenbao"></i><span>游戏管理</span><i class="arrow_icon"></i></div>
<div class="navContent jsnavContent">
<!-- <a href="{:U('Apply/app_index')}" class="<if condition='CONTROLLER_NAME eq Apply and ACTION_NAME eq app_index '>active</if> ">APP列表</a>-->

@ -59,7 +59,6 @@
</volist>
</div>
</div>
<img src="__IMG__/20180207/icon_normal_game.png"><span class="title_main">{$meta_title}</span>
<span class="title_main">安全密码</span>
</div>
<div class="trunk-content article">

@ -23,6 +23,9 @@ return array(
'DATA_CACHE_PREFIX' => 'onethink_', // 缓存前缀
'DATA_CACHE_TYPE' => 'File', // 数据缓存类型
/*获取信息加密KEY*/
'GET_INFO_KEY' => 'wmkjtx_kj213',
/* 文件上传相关配置 */
'DOWNLOAD_UPLOAD' => array(
'mimes' => '', //允许上传的文件MiMe类型

@ -0,0 +1,342 @@
<?php
/**
* Created by PhpStorm.
* User: 67snow
* Date: 2019/8/5
* Time: 16:04
*/
namespace Sdk\Controller;
use Think\Controller;
use Think\Log;
class FengHuoApi2Controller extends GetInfoBaseController{
// protected function _initialize(){
// // 制定允许其他域名访问
// header("Access-Control-Allow-Origin:*");
//// 响应类型
// header('Access-Control-Allow-Methods:POST');
//// 响应头设置
// header('Access-Control-Allow-Headers:x-requested-with, content-type');
//// var_dump(111);
// $key = '138FE30A2C';
// $data = $_REQUEST;
//
// $md5Sign = $data['signatureMD5'];
// unset($data['signatureMD5']);
// $time = $data['time'];
// $page = $data['page'];
// $pageSize = $data['page_size'];
// $appId = $data['app_id'];
// $signatureStamp = $data['signature_stamp'];
//
// if(empty($md5Sign) || empty($time) || empty($page) || empty($pageSize) || empty($appId) || empty($signatureStamp)){
// return $this->ajaxReturn(array("ResultCode"=>0,"ResultMessage"=>"缺少必要的参数","Data"=>"null"));
// }
//
//
// $signData = array($appId,$page,$pageSize,$signatureStamp,$time);
// $md5_sign = md5(http_build_query($signData).$key);
//
//
// if($md5Sign != $md5_sign){
// return $this->ajaxReturn(array("ResultCode"=>0,"ResultMessage"=>"验签失败"));
// }
// $endSignatureStamp = intval(time()) + 600;
// if($signatureStamp > $endSignatureStamp){
// return $this->ajaxReturn(array("ResultCode"=>0,"ResultMessage"=>"请求超时"));
// }
//
// $pageSize = intval($pageSize);
// if($pageSize > 1000){
// return $this->ajaxReturn(array("ResultCode"=>0,"ResultMessage"=>"每页数量数值过大"));
// }
// }
/**
* 注册明细
* @param
*/
public function registerDetail(){
$time = $_REQUEST['time'];
$page = $_REQUEST['page'];
$pageSize = $_REQUEST['page_size'];
//时间区间
if (isset($time)) {
$where['register_time'] = array('between',[$time,$time+86399]);
}
// 第几页数据
$page = intval($page);
$page = $page ? $page : 1; //默认显示第一页数据
// 一页显示数据的条数
$pageSize = intval($pageSize);
$row = $pageSize ? $pageSize : 1000;
// 默认排序id降序
$order = 'register_time asc';
$data = M('user','tab_')
->field('id,account,promote_account,register_ip,register_time,device_type,device_number,fgame_name')
->where($where)
->order($order)
->page($page, $row)
->select();
foreach ($data as $k => $v) {
$bindType = $v['device_type'];
if ($bindType == 1) {
$data[$k]['device_type'] = 'Android';
}elseif($bindType == 2) {
$data[$k]['device_type'] = 'IOS';
}else{
if(!empty($v['fgame_name'])){
$gameServer = substr($v['fgame_name'], -10, 9);
if($gameServer == '安卓版'){
$data[$k]['device_type'] = 'Android';
} elseif($gameServer == '苹果版') {
$data[$k]['device_type'] = 'IOS';
}
}
}
unset($data[$k]['fgame_name']);
}
if($data){
$result = [
'ResultCode' => 1,
'ResultMessage' => "调用成功",
'Data' => $data
];
}else{
$result = [
'ResultCode' => 1,
'ResultMessage' => "没有数据,换个条件试试吧",
'Data' => 'null'
];
}
Log::write('registerDetail:' . date('Y-m-d H:i:s') . ' ---- ' . json_encode($result), 'INFO');
return $this->ajaxReturn($result);
}
/**
* 支付明细
* @param
*/
public function payDetail(){
$time = $_REQUEST['time'];
$page = $_REQUEST['page'];
$pageSize = $_REQUEST['page_size'];
//时间区间
if (isset($time)) {
$where['pay_time'] = array('between',[$time,$time+86399]);
}
// 第几页数据
$page = intval($page);
$page = $page ? $page : 1; //默认显示第一页数据
// 一页显示数据的条数
$pageSize = intval($pageSize);
$row = $pageSize ? $pageSize : 1000;
// 默认排序id降序
$order = 'pay_time asc';
$where['pay_status'] = array('neq',0);
$data = M('spend','tab_')
->field('pay_order_number,promote_account,user_id,game_name,game_player_name,server_name,pay_time,cost,user_account')
->where($where)
->order($order)
->page($page, $row)
->select();
if($data){
$result = [
'ResultCode' => 1,
'ResultMessage' => '调用成功',
'Data' => $data
];
}else{
$result = [
'ResultCode' => 1,
'ResultMessage' => '没有数据,换个条件试试吧',
'Data' => 'null'
];
}
Log::write('payDetail:' . date('Y-m-d H:i:s') . ' ---- ' . json_encode($result), 'INFO');
return $this->ajaxReturn($result);
}
/**
* 玩家角色信息
* @param
*/
public function roleInfo(){
$time = $_REQUEST['time'];
$page = $_REQUEST['page'];
$pageSize = $_REQUEST['page_size'];
//时间区间
if (isset($time)) {
$where['play_time'] = array('between',[$time,$time+86399]);
}
// 第几页数据
$page = intval($page);
$page = $page ? $page : 1; //默认显示第一页数据
// 一页显示数据的条数
$pageSize = intval($pageSize);
$row = $pageSize ? $pageSize : 1000;
// 默认排序id降序
$order = 'play_time asc';
$data = M('user_play_info','tab_')
->field('promote_account,user_id,game_name,server_name,role_name,role_level,play_time,role_id,user_account')
->where($where)
->order($order)
->page($page, $row)
->select();
if($data){
$result = [
'ResultCode' => 1,
'ResultMessage' => "调用成功",
'Data' => $data
];
}else{
$result = [
'ResultCode' => 1,
'ResultMessage' => "没有数据,换换条件吧",
'Data' => 'null'
];
}
Log::write('roleInfo:' . date('Y-m-d H:i:s') . ' ---- ' . json_encode($result), 'INFO');
return $this->ajaxReturn($result);
}
/**
* 玩家登陆信息
* @param
*/
public function loginInfo(){
$time = $_REQUEST['time'];
$page = $_REQUEST['page'];
$pageSize = $_REQUEST['page_size'];
//时间区间
if (isset($time)) {
$where['login_time'] = array('between',[$time,$time+86399]);
}
// 第几页数据
$page = intval($page);
$page = $page ? $page : 1; //默认显示第一页数据
// 一页显示数据的条数
$pageSize = intval($pageSize);
$row = $pageSize ? $pageSize : 1000;
// 默认排序id降序
$order = 'login_time asc';
$where['login_time'] = array('neq',0);
$data = M('user_login_record','tab_')
->field('user_id,game_name,server_name,login_time,user_account,game_player_name')
->where($where)
->order($order)
->page($page, $row)
->select();
foreach ($data as $k=>$v){
$promoteId = $v['promote_id'];
if($promoteId == 0){
$data[$k]['promote_account'] = '官方渠道';
}else{
$promote_account = M('promote','tab_')
->field('account')
->where('id',$promoteId)
->find();
$data[$k]['promote_account'] = $promote_account;
}
}
if($data){
$result = [
'ResultCode' => 1,
'ResultMessage' => "调用成功",
'Data' => $data
];
}else{
$result = [
'ResultCode' => 1,
'ResultMessage' => "没有数据,换个条件试试吧",
];
}
Log::write('loginInfo:' . date('Y-m-d H:i:s') . ' ---- ' . json_encode($result), 'INFO');
return $this->ajaxReturn($result);
}
/**
* 换绑记录
* @param
*/
public function bindHistory()
{
$time = $_REQUEST['time'];
$page = $_REQUEST['page'];
$pageSize = $_REQUEST['page_size'];
//时间区间
if (isset($time)) {
$where['m.create_time'] = array('between', [$time, $time + 86399]);
}
// 第几页数据
$page = intval($page);
$page = $page ? $page : 1; //默认显示第一页数据
// 一页显示数据的条数
$pageSize = intval($pageSize);
$row = $pageSize ? $pageSize : 1000;
// 默认排序id降序
$order = 'm.create_time asc';
$data = M('mend as m', 'tab_')
->join('tab_user as u on m.user_id = u.id','LEFT')
->field('m.user_id,m.create_time,m.promote_account,m.promote_account_to,m.bind_type,m.user_account,u.register_time')
->where($where)
->order($order)
->page($page, $row)
->select();
foreach ($data as $k => $v) {
$bindType = $v['bind_type'];
if ($bindType == 1) {
$data[$k]['bind_type'] = 'In';
}elseif($bindType == 2){
$data[$k]['bind_type'] = 'Out';
}
}
if ($data) {
$result = [
'ResultCode' => 1,
'ResultMessage' => "调用成功",
'Data' => $data
];
} else {
$result = [
'ResultCode' => 1,
'ResultMessage' => "没有数据,换个条件试试吧",
];
}
Log::write('bindHistory:' . date('Y-m-d H:i:s') . ' ---- ' . json_encode($result), 'INFO');
return $this->ajaxReturn($result);
}
}

@ -5,7 +5,7 @@
* Date: 2019/8/5
* Time: 16:04
*/
namespace SDK\Controller;
namespace Sdk\Controller;
use Think\Controller;
use Think\Log;
@ -76,7 +76,7 @@ class FengHuoApiController extends Controller{
// 默认排序id降序
$order = 'register_time asc';
$data = M('user','tab_')
->field('id,account,promote_account,register_ip,register_time,device_type,device_number')
->field('id,account,promote_account,register_ip,register_time,device_type,device_number,fgame_name')
->where($where)
->order($order)
->page($page, $row)
@ -87,7 +87,17 @@ class FengHuoApiController extends Controller{
$data[$k]['device_type'] = 'Android';
}elseif($bindType == 2) {
$data[$k]['device_type'] = 'IOS';
}else{
if(!empty($v['fgame_name'])){
$gameServer = substr($v['fgame_name'], -10, 9);
if($gameServer == '安卓版'){
$data[$k]['device_type'] = 'Android';
} elseif($gameServer == '苹果版') {
$data[$k]['device_type'] = 'IOS';
}
}
}
unset($data[$k]['fgame_name']);
}
@ -104,7 +114,6 @@ class FengHuoApiController extends Controller{
'Data' => 'null'
];
}
Log::write('registerDetail:' . date('Y-m-d H:i:s') . ' ---- ' . json_encode($result), 'INFO');
return $this->ajaxReturn($result);

@ -0,0 +1,39 @@
<?php
namespace Sdk\Controller;
use Think\Controller;
class GetInfoBaseController extends Controller
{
public function _initialize()
{
$data = I('param.');
if (empty($data['time_stamp']) || time() - 60 * 10 > $data['time_stamp']) {
$result = [
'ResultCode' => 2002,
'ResultMessage' => "链接已过期",
'Data' => 'null',
];
return $this->ajaxReturn($result);
} else {
$sign = $data['sign'];
unset($data['sign']);
ksort($data);
reset($data);
$str = "";
foreach ($data as $k => $v) {
$str = $str . $k . "=" . $v;
}
$str = $str . 'key=' . C('GET_INFO_KEY');
if (md5($str) != $sign) {
$result = [
'ResultCode' => 2001,
'ResultMessage' => "参数错误",
'Data' => 'null',
];
return $this->ajaxReturn($result);
}
}
}
}

@ -5,7 +5,7 @@
* Date: 2016/11/4
* Time: 16:04
*/
namespace SDK\Controller;
namespace Sdk\Controller;
use Think\Controller;
class OAController extends Controller{

@ -336,3 +336,25 @@ CREATE TABLE `tab_spend_user_count` (
KEY `count_date` (`count_date`) USING BTREE
) ENGINE=MyISAM AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='流水角色聚合表';
-- 2019-11-6 cxj
ALTER TABLE `tab_spend` ADD COLUMN `withdraw_id` int(11) NOT NULL DEFAULT 0 COMMENT '提现ID' AFTER `pay_url`;
ALTER TABLE `tab_withdraw` ADD COLUMN `settlement_end_time` int(10) NOT NULL DEFAULT 0 COMMENT '结算截止时间' AFTER `old_promote_account`;
-- 2019-11-07 chenzhi
INSERT INTO `sys_menu` (`title`, `pid`, `sort`, `url`, `hide`, `tip`, `group`, `is_dev`, `status`) VALUES ('补链详情', '192', '0', 'Mend/shiftInfo', '0', '', '推广补链', '0', '1');
ALTER TABLE `tab_spend_user_count`
ADD COLUMN `bind_coin_count` decimal(10,2) NULL DEFAULT 0.00 COMMENT '绑定币消耗' AFTER `balance_coin_count`;
-- 2019-11-6 ylw 设备禁用信息表
CREATE TABLE `tab_device_bans` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '风控表ID',
`tag` varchar(255) NOT NULL COMMENT '风控标识',
`type` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '类型 0未知 1设备号 2IP',
`operator_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '操作者ID',
`create_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '创建时间',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
-- 2019-11-07 elf 迁移任务
ALTER TABLE `sys_shift_task` ADD COLUMN `shift_ids` varchar(255) NOT NULL DEFAULT '' COMMENT '迁移ID';
ALTER TABLE `sys_shift_task` ADD COLUMN `remark` varchar(255) NOT NULL DEFAULT '' COMMENT '备注';

@ -1,5 +1,11 @@
{
"require": {
"rodneyrehm/plist": "^2.0"
},
"repositories": {
"packagist": {
"type": "composer",
"url": "https://packagist.phpcomposer.com"
}
}
}

Loading…
Cancel
Save