master
ELF 4 years ago
parent 3383b3d2d9
commit 9c59ba06e2

@ -22,6 +22,6 @@ class GameApiController extends Think {
public function getGameCatPayTypes() {
$gameCatClient = new GameCatClient();
$result = $gameCatClient->api('get-pay-type');
var_dump($result);
}
}

@ -10,15 +10,24 @@ use GuzzleHttp\Exception\RequestException;
*/
class GameCatClient
{
const SIGN_NAME = 'Sign';
const SIGN_NAME = 'sign';
const SUCCESS = '0000';
protected $client;
private $apis = [
'get-pay-type' => ['uri' => '/api/pay/GetPayType', 'method' => 'get'],
'internal-pay' => ['uri' => '/api/pay/InternalPayOrder/yushi', 'method' => 'post'],
'check-role' => ['uri' => '/api/pay/CheckActorID', 'method' => 'get']
'get-pay-type' => ['uri' => '/game/support/items/v1', 'method' => 'post'],
'internal-pay' => ['uri' => '/game/support/provide/v1', 'method' => 'post'],
];
private $appIds = [
'andriod' => 1746,
'ios' => 1747,
];
private $channelIds = [
'andriod' => 11595,
'ios' => 11596,
];
public function __construct()
@ -35,6 +44,13 @@ class GameCatClient
if (is_null($api)) {
throw new \Exception('接口不存在');
}
$deviceType = 'andriod';
if (isset($params['device_type'])) {
$deviceType = $params['device_type'];
unset($params['device_type']);
}
$params['appId'] = $this->appIds[$deviceType] ?? $this->appIds['andriod'];
$params['channelId'] = $this->channelIds[$deviceType] ?? $this->channelIds['andriod'];
$params[self::SIGN_NAME] = $this->sign($params);
try {

@ -24,9 +24,7 @@ class TestingResourceController extends BaseController
$loginPromote = $this->getLoginPromote();
$conditions = [];
$subConditions = [
'promote_id' => $loginPromote['id'],
];
$subConditions = [];
if ($createTimeStart) {
$subConditions['create_time'] = ['egt', strtotime($createTimeStart . ' 00:00:00')];
@ -38,6 +36,9 @@ class TestingResourceController extends BaseController
$subSql = M('testing_user', 'tab_')->field(['user_id'])->where($subConditions)->select(false);
$strCondition = 'user_id in (' . $subSql . ')';
$promoteService = new PromoteService();
$strCondition .= ' and promote_id in (' . $promoteService->subInSql($loginPromote) . ')';
if ($account) {
$user = M('user', 'tab_')->field(['id'])->where('account like ' . $account . '%')->find();
if ($user) {
@ -74,17 +75,23 @@ class TestingResourceController extends BaseController
$bindings = index_by_column('role_id', $bindings);
$bindingRoleIds = array_column($bindings, 'bind_role_id');
if (count($bindings) > 0) {
$bindingRoles = M('user_play_info', 'tab_')->field(['id', 'role_name'])->where(['id' => ['in', $bindingRoleIds]])->select();
$bindingRoles = M('user_play_info', 'tab_')->field(['id', 'role_id', 'role_name', 'user_account'])->where(['id' => ['in', $bindingRoleIds]])->select();
$bindingRoles = index_by_column('id', $bindingRoles);
}
}
if (count($bindingRoles) > 0) {
M('spend', 'tab_')->where();
}
$records = [];
foreach ($roles as $role) {
$user = $users[$role['user_id']] ?? null;
$binding = $bindings[$role['id']] ?? null;
$bindingRole = $binding && $bindingRoles[$binding['bind_role_id']] ? $bindingRoles[$binding['bind_role_id']] : null;
$records[] = [
'id' => $role['id'],
'game_name' => $role['game_name'],
'server_name' => $role['server_name'],
'server_id' => $role['server_id'],
@ -94,7 +101,7 @@ class TestingResourceController extends BaseController
'role_name' => $role['role_name'],
'bind_user_account' => $bindingRole ? $bindingRole['user_account'] : '',
'bind_role_name' => $bindingRole ? $bindingRole['role_name'] : '',
'base_quota' => $binding ? $binding['base_quota'] : 1200,
'base_quota' => $binding ? $binding['base_quota'] : 0,
'other_quota' => $binding ? $binding['other_quota'] : 0,
'quota' => 0,
'verify_amount' => 0,
@ -128,7 +135,11 @@ class TestingResourceController extends BaseController
$errorCount = 0;
$successCount = 0;
if (count($newAccounts)) {
$users = M('user', 'tab_')->field(['id', 'account'])->where(['account' => ['in', $newAccounts]])->select();
$promoteService = new PromoteService();
$strCondition = 'promote_id in (' . $promoteService->subInSql($loginPromote) . ')';
$users = M('user', 'tab_')->field(['id', 'account'])->where(['account' => ['in', $newAccounts], '_string' => $strCondition])->select();
$errorAccounts = array_diff($newAccounts, array_column($users, 'account'));
$errorCount = count($errorAccounts);
foreach ($users as $user) {
@ -139,7 +150,6 @@ class TestingResourceController extends BaseController
'user_id' => $user['id'],
'user_account' => $user['account'],
'status' => 1,
'promote_id' => $loginPromote['id'],
'create_time' => time(),
'update_time' => time(),
];
@ -191,6 +201,48 @@ class TestingResourceController extends BaseController
$query = M('testing_resource_batch', 'tab_')->where($conditions)->order('create_time desc')->select();
list($batches, $pagination, $count) = $this->paginate($query);
$records = [];
foreach ($batches as $batch) {
$records[] = [
'id' => $batch['id'],
'batch_no' => $batch['batch_no'],
'create_time' => date('Y-m-d H:i:s', $batch['create_time']),
'game_name' => $batch['game_id'],
'server_name' => $batch['server_id'],
'role_name' => $batch['role_id'],
'user_account' => $batch['user_id'],
'user_phone' => $batch['batch_no'],
'creator_account' => $batch['batch_no'],
'history_provide_amount' => 0.00,
'apply_amount' => $batch['apply_amount'],
'provide_amount' => $batch['provide_amount'],
'remark' => $batch['remark'],
'verify_status_text' => $batch['verify_status'],
'verify_time' => date('Y-m-d H:i:s', $batch['verify_time']),
'status_text' => $batch['status'],
'provide_status_text' => $batch['provide_status'],
'provide_time' => date('Y-m-d H:i:s', $batch['provide_time']),
'content' => $content,
];
}
$this->assign('count', $count);
$this->assign('pagination', $pagination);
$this->assign('records', $records);
$this->display();
}
public function orders()
{
$batchId = I('batch_id', 0);
$query = M('testing_resource_order', 'tab_')->where(['batch_id' => $batchId])->order('create_time desc')->select();
list($orders, $pagination, $count) = $this->paginate($query);
/**
* @todo
*/
$this->assign('count', $count);
$this->assign('pagination', $pagination);
$this->assign('records', $records);
@ -199,16 +251,31 @@ class TestingResourceController extends BaseController
public function apply()
{
$records = [];
$pagination = '';
$roleId = I('role_id', 0);
$role = null;
if ($roleId > 0) {
$role = M('user_play_info', 'tab_')->field(['id', 'role_id', 'user_id', 'game_id', 'server_id', 'user_account', 'role_name'])->where(['id' => $roleId])->find();
}
$servers = [];
$bindingRole = null;
if ($role) {
$servers = M('server', 'tab_')->field('id,server_name,server_id')->where(['game_id' => $role['game_id']])->order('server_id asc')->select();
$binding = M('testing_binding', 'tab_')->where(['role_id' => $roleId])->find();
if ($binding) {
$bindingRole = M('user_play_info', 'tab_')->field(['id', 'role_id', 'user_id', 'game_id', 'server_id', 'user_account', 'role_name'])->where(['id' => $binding['bind_role_id']])->find();
}
}
/**
* @todo 目前固定游戏猫
*/
$games = M('game', 'tab_')->field(['id' , 'game_name'])->where(['id' => ['in', [229, 230]]])->select();
$this->assign('games', $games);
$this->assign('records', $records);
$this->assign('pagination', $pagination);
$this->assign('servers', $servers);
$this->assign('bindingRole', $bindingRole);
$this->assign('role', $role);
$this->display();
}
@ -311,56 +378,56 @@ class TestingResourceController extends BaseController
public function bindRole()
{
$testingUserId = I('testing_user_id', 0);
$testingRoleId = I('testing_role_id', 0);
$bindUserId = I('bind_user_id', 0);
$bindRoleId = I('bind_role_id', 0);
$bindUser = M('user', 'tab_')->field(['id', 'account'])->where(['id' => $bindUserId])->find();
if (is_null($bindUser)) {
return $this->ajaxReturn(['status' => 0, 'message' => '用户不存在']);
}
$testingUser = M('testing_user', 'tab_')->where(['user_id' => $testingUserId])->find();
if (is_null($testingUser)) {
return $this->ajaxReturn(['status' => 0, 'message' => '测试账号不存在']);
}
$testingRole = M('user_play_info', 'tab_')
->field(['id', 'role_id'])
->field(['id', 'role_id', 'user_id'])
->where(['id' => $testingRoleId])
->find();
if (is_null($testingRole)) {
return $this->ajaxReturn(['status' => 0, 'message' => '测试账号角色不存在']);
}
$testingUser = M('testing_user', 'tab_')->where(['user_id' => $testingRole['user_id']])->find();
if (is_null($testingUser)) {
return $this->ajaxReturn(['status' => 0, 'message' => '测试账号不存在']);
}
$bindRole = M('user_play_info', 'tab_')
->field(['id', 'role_id'])
->field(['id', 'role_id', 'user_id'])
->where(['id' => $bindRoleId])
->find();
if (is_null($bindRole)) {
return $this->ajaxReturn(['status' => 0, 'message' => '玩家角色不存在']);
}
$existBind = M('testing_user', 'tab_')->field(['id'])->where(['bind_user_id' => $bindUser['id']])->find();
$bindIsTesting = M('testing_user', 'tab_')->where(['user_id' => $bindRole['user_id']])->find();
if ($bindIsTesting) {
return $this->ajaxReturn(['status' => 0, 'message' => '该玩家账号为测试账号,无法绑定']);
}
$existBind = M('testing_binding', 'tab_')->field(['id'])->where(['bind_role_id' => $bindRoleId])->find();
if ($existBind) {
return $this->ajaxReturn(['status' => 0, 'message' => '该玩家账号已被绑定']);
return $this->ajaxReturn(['status' => 0, 'message' => '该玩家角色已被绑定']);
}
$testExistBind = M('testing_binding', 'tab_')->field(['id'])->where(['role_id' => $testingRoleId])->find();
if ($testExistBind) {
return $this->ajaxReturn(['status' => 0, 'message' => '该测试账号角色已绑定有角色']);
}
M('testing_user', 'tab_')->where(['user_id' => $testingUserId])->save([
M('testing_binding', 'tab_')->add([
'user_id' => $testingRole['user_id'],
'role_id' => $testingRole['id'],
'bind_user_id' => $bindUser['id'],
'bind_user_account' => $bindUser['account'],
'bind_role_id' => $bindRoleId,
'bind_user_id' => $bindRole['user_id'],
'bind_role_id' => $bindRole['id'],
'create_time' => time(),
'update_time' => time()
]);
return $this->ajaxReturn(['status' => 1, 'message' => '绑定成功']);
}
public function getRolesByUser()
{
}
public function getServers()
{
$gameId = I('game_id', 0);
@ -382,8 +449,10 @@ class TestingResourceController extends BaseController
/**
* @todo 目前固定游戏猫
*/
if (in_array($gameId, [229, 230])) {
if ($gameId == 229) {
$resourceTypes[] = ['id' => 1, 'name' => '通用'];
} elseif ($gameId == 230) {
$resourceTypes[] = ['id' => 2, 'name' => '通用'];
}
return $this->ajaxReturn(['status' => 1, 'message' => '获取成功', 'data' => ['resourceTypes' => $resourceTypes]]);
}
@ -397,8 +466,10 @@ class TestingResourceController extends BaseController
/**
* @todo 目前固定游戏猫资源类型ID
*/
if ($typeId == 1) {
$resources = $this->getGameCatResources();
if ($typeId == 2) {
$resources = $this->getGameCatResources('ios');
} elseif ($typeId == 1) {
$resources = $this->getGameCatResources('andriod');
}
return $this->ajaxReturn(['status' => 1, 'message' => '获取成功', 'data' => ['resources' => $resources]]);
@ -413,25 +484,29 @@ class TestingResourceController extends BaseController
if (is_null($server)) {
return $this->ajaxReturn(['status' => 0, 'message' => '区服不存在']);
}
$testingUser = M('testing_user', 'tab_')->where(['user_account' => $userAccount])->find();
$isTestingAccount = is_null($testingUser) ? false : true;
$roles = M('user_play_info', 'tab_')
->field(['id', 'role_name'])
->where(['user_account' => $userAccount, 'game_id' => $gameId, 'server_id' => $server['server_id']])
->select();
return $this->ajaxReturn(['status' => 1, 'message' => '获取成功', 'data' => ['roles' => $roles]]);
return $this->ajaxReturn(['status' => 1, 'message' => '获取成功', 'data' => ['roles' => $roles, 'is_testing_account' => $isTestingAccount]]);
}
private function getGameCatResources()
private function getGameCatResources($deviceType)
{
$resources = [];
$gameCatClient = new GameCatClient();
$result = $gameCatClient->api('get-pay-type');
if ($result['code'] == 1) {
$payTypeList = $result['paytypelist'];
foreach ($payTypeList as $item) {
$resources[$item['PayType']] = [
'ref_id' => $item['PayType'],
'name' => $item['Text'],
'amount' => $item['Amount'],
$result = $gameCatClient->api('get-pay-type', ['device_type' => $deviceType]);
if ($result['state'] == 1) {
$items = $result['data'];
foreach ($items as $item) {
$resources[$item['supportItem']] = [
'ref_id' => $item['supportItem'],
'name' => $item['content'],
'amount' => $item['amount'],
];
}
}

@ -88,30 +88,44 @@
<form method="post" class="clearfix">
<div class="clearfix">
<div class="form-group fl">
<select id="game-select" name="" class="select_gallery" style="width:150px">
<select id="game-select" name="" class="select_gallery" style="width:150px" <?php if($role):?>disabled<?php endif;?>>
<option value="0">请选择游戏</option>
<?php foreach($games as $game):?>
<option value="<?=$game['id']?>"><?=$game['game_name']?></option>
<option value="<?=$game['id']?>" <?php if($role && $role['game_id'] == $game['id']):?>selected<?php endif;?>>
<?=$game['game_name']?>
</option>
<?php endforeach;?>
</select>
</div>
<div class="form-group fl">
<select id="server-select" class="select_gallery" style="width:150px">
<select id="server-select" class="select_gallery" style="width:150px" <?php if($role):?>disabled<?php endif;?>>
<option value="0">请选择区服</option>
<?php foreach($servers as $server):?>
<option value="<?=$server['id']?>" <?php if($role && $server['server_id'] == $role['server_id']):?>selected<?php endif;?>>
<?=$server['server_name']?>
</option>
<?php endforeach;?>
</select>
</div>
<div class="form-group fl">
<input id="test_account" type="text" name="account" class="txt normal_txt" id="uid" placeholder="请输入测试资源账号" value="{:I('account')}">
<input id="test_account" type="text" name="account" class="txt normal_txt" placeholder="请输入测试资源账号" value="{$role.user_account}" <?php if($role):?>disabled<?php endif;?>>
</div>
<div class="form-group fl">
<select id="role-select" name="role_id" class="select_gallery" style="width:150px">
<select id="role-select" name="role_id" class="select_gallery" style="width:150px" <?php if($role):?>disabled<?php endif;?>>
<option value="0">请选择角色</option>
<?php if($role):?>
<option value="<?=$role['id']?>" selected><?=$role['role_name']?></option>
<?php endif;?>
</select>
</div>
</div>
<div class="info-row">
<button id="bind-btn" type="button">绑定玩家账号</button>
<?php if($bindingRole):?>
<button type="button">绑定角色: <?= $bindingRole['role_name']?></button>
<div class="" style="display:inline-block; margin-left: 10px;">当前可用额度1364 待审核额度0</div>
<?php else:?>
<button id="bind-btn" type="button">绑定玩家角色</button>
<?php endif;?>
</div>
<div class="clearfix" style="margin-top: 10px;">
<div class="form-group fl">
@ -169,20 +183,20 @@
<div class="form-group">
<label>玩家账号</label>
<div class="form-item" style="width: 250px">
<input name="account" type="text" class="form-input" style="width: 100%;">
<input id="bind_account" name="account" type="text" class="form-input" style="width: 100%;">
</div>
</div>
<div class="form-group">
<label>玩家角色</label>
<div class="form-item" style="width: 250px">
<select id="role-select" name="role_id" style="width:270px" class="select_gallery">
<select id="bind-role-select" name="role_id" style="width:270px" class="select_gallery">
<option value="">请选择</option>
</select>
</div>
</div>
<div class="form-group">
<label></label>
<a id="add-submit" href="javascript:;" class="add-submit btn">确定</a>
<a id="submit-bind" href="javascript:;" class="add-submit btn">确定</a>
</div>
</form>
</div>
@ -191,7 +205,10 @@
<script type="text/javascript" src="__JS__/20170831/select2.min.js"></script>
<script type="text/javascript">
$(".select_gallery").select2()
var globalGameId = 0
var globalGameId = $('#game-select').val()
if (globalGameId > 0) {
initTable(globalGameId)
}
$('#game-select').on({
change: function () {
var gameId = $(this).val()
@ -338,32 +355,73 @@
if (serverId == 0) {
return layer.msg('请选择区服')
}
var userAccount = $('#test_account').val()
if (userAccount == '') {
return layer.msg('请输入测试资源账号')
}
var userAccount = $('#test_account').val()
$.ajax({
url: "{:U('getUserRoles')}",
type: "post",
data: { user_account: userAccount, game_id: gameId, server_id: serverId },
dataType: 'json',
success: function(result){
if (result.status == 1) {
var roles = result.data.roles
if (roles.length == 0) {
return layer.msg('当前账号不属于该区服')
}
var html = "<option value='0'>请选择角色</option>";
for (var i in roles){
html += "<option value='"+roles[i].id+"'>"+roles[i].role_name+"</option>"
}
$("#role-select").html(html);
$("#role-select").select2();
} else {
layer.msg(result.message)
}
getUserRoles(userAccount, gameId, serverId, function(roles, isTestingAccount) {
if (roles.length == 0) {
return layer.msg('当前账号在该区服未创建角色')
}
})
if (!isTestingAccount) {
return layer.msg('此账号非测试账号')
}
var html = "<option value='0'>请选择角色</option>";
for (var i in roles){
html += "<option value='"+roles[i].id+"'>"+roles[i].role_name+"</option>"
}
$("#role-select").html(html);
$("#role-select").select2();
})
}
})
function getUserRoles(userAccount, gameId, serverId, callback) {
$.ajax({
url: "{:U('getUserRoles')}",
type: "post",
data: { user_account: userAccount, game_id: gameId, server_id: serverId },
dataType: 'json',
success: function(result){
if (result.status == 1) {
var roles = result.data.roles
var isTestingAccount = result.data.is_testing_account
callback(roles, isTestingAccount)
} else {
layer.msg(result.message)
}
}
})
}
$('#bind_account').on({
blur: function () {
var gameId = $('#game-select').val()
if (gameId == 0) {
return layer.msg('请选择游戏')
}
var serverId = $('#server-select').val()
if (serverId == 0) {
return layer.msg('请选择区服')
}
var userAccount = $('#bind_account').val()
if (userAccount == '') {
return layer.msg('请输入玩家账号')
}
getUserRoles(userAccount, gameId, serverId, function(roles, isTestingAccount) {
if (roles.length == 0) {
return layer.msg('玩家账号在该区服未创建角色')
}
if (isTestingAccount) {
return layer.msg('此账号为测试账号,无法绑定')
}
var html = "<option value='0'>请选择角色</option>";
for (var i in roles){
html += "<option value='"+roles[i].id+"'>"+roles[i].role_name+"</option>"
}
$("#bind-role-select").html(html);
$("#bind-role-select").select2();
})
}
})
@ -387,7 +445,7 @@
$('#bind-btn').click(function () {
var box = $('#bind-box')
layer.open({
title: '绑定玩家账号',
title: '绑定玩家角色',
type: 1,
content: box,
area: ['500px', '250px'],
@ -396,6 +454,32 @@
})
});
$('#submit-bind').click(function () {
var roleId = $('#role-select').val()
if (roleId == 0) {
return layer.msg('请选择测试账号角色')
}
var bindRoleId = $('#bind-role-select').val()
if (bindRoleId == 0) {
return layer.msg('请选择玩家角色')
}
$.ajax({
url: "{:U('bindRole')}",
type: "post",
data: { bind_role_id: bindRoleId, testing_role_id: roleId},
dataType: 'json',
success: function(result){
if (result.status == 1) {
layer.msg(result.message, function(){
window.location.href = window.location.href
})
} else {
layer.msg(result.message)
}
}
})
})
$('#submit-btn').on({
click: function () {
var records = getRecords()

@ -0,0 +1,353 @@
<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">
<style>
.page-list .trunk-search{
padding-top: 20px;
}
</style>
</block>
<block name="body">
<div class="page-list normal_list apply-app_apply-list">
<div class="trunk-title">
<div class="location">
<div class="location-container">当前位置:<span>测试资源></span><span>测试资源申请记录</span></div>
</div>
<img src="__IMG__/20180207/icon_normal_shenqing.png">
<span class="title_main">测试资源申请记录</span>
<span class="details">说明:测试资源申请记录</span>
</div>
<div class="trunk-content article">
<div class="trunk-search clearfix">
<div id="form1">
<div class="form-group normal_space fr">
<input type="submit" class="submit" id='submit' value="查询" url="{:U('lists',['type'=>I('type')])}" style="cursor:pointer;">
</div>
<div class="form-group normal_space fr" style="margin-left: 9px;">
<label class="form-title select-title" style="margin-right: 9px;"></label>
<div class="select-time">
<input type="text" id="edate" class="txt" name="end" placeholder="结束时间" value="{:I('end')}" autocomplete="off">
</div>
</div>
<div class="form-group normal_space fr">
<label class="form-title select-title">申请时间:</label>
<div class="select-time">
<input type="text" id="sdate" class="txt" name="start" placeholder="开始时间" value="{:I('start')}" autocomplete="off">
</div>
</div>
<div class="form-group normal_space fr">
<input type="text" name="user_account" class="txt normal_txt" id="uid" style="width:110px;" placeholder="请输入玩家账号" value="{:I('user_account')}" onKeyDown="webchat_chkkeysend(event);">
</div>
<div class="form-group normal_space fr">
<input type="text" name="role_name" class="txt normal_txt" style="width:110px;" placeholder="角色名" value="{:I('role_name')}" onKeyDown="webchat_chkkeysend(event);">
</div>
<div class="form-group normal_space fr">
<span id="server_js">
<select id="server_id" name="server_name" class="reselect select_gallery" style="width:101px">
<option game-id="0" value="">请选择区服</option>
<volist name=":getServer_name_on($_GET['game_name'])" id="vo">
<option value="{$vo.server_name}" <if condition="$_GET['server_name'] eq $vo['server_name']">selected="selected"</if>>{$vo.server_name}</option>
</volist>
</select>
</span>
</div>
<div class="form-group normal_space fr">
<select id="game_id" name="game_name" class="reselect select_gallery" >
<option game-id="0" value="">请选择游戏</option>
<volist name=":get_game_list()" id="vo">
<option game-id="{$vo.id}" value="{$vo.game_name}" <if condition="$_GET['game_name'] eq $vo['game_name']">selected="selected"</if>>{$vo.game_name}</option>
</volist>
</select>
</div>
</div>
</div>
</div>
<div class="page-list apply-app_apply-list query-recharge-list">
<div class="trunk-content article">
<div class="tabcon trunk-list">
<table class="table normal_table zwm_tab">
<tr class="odd zwm_tr">
<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>
<th>发放时间</th>
<th>资源内容</th>
</tr>
<empty name="records">
<tr><td colspan="16" 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="records" id="record" mod="2">
<tr data-id="{$record.id}" class="<eq name='mod' value='1'>odd</eq>">
<td>{$record.batch_no}</td>
<td>{$record.create_time}</td>
<td>{$record.game_name}</td>
<td>{$record.server_name}</td>
<td>{$record.role_name}</td>
<td>{$record.user_account}</td>
<td>{$record.user_phone}</td>
<td>{$record.apply_promote_account}</td>
<td>{$record.history_provide_amount}</td>
<td>{$record.apply_amount}</td>
<td>{$record.provide_amount}</td>
<td>{$record.remark}</td>
<td>{$record.verify_status_text}</td>
<td>{$record.verify_time}</td>
<td>{$record.status_text}</td>
<td>{$record.provide_status_text}</td>
<td>{$record.provide_time}</td>
<td>{$record.content}</td>
</tr>
</volist>
</empty>
</table>
<div class="pagenation clearfix">
{$pagination}
</div>
</div>
</div>
</div>
</div>
</block>
<block name="script">
<link rel="stylesheet" type="text/css" href="__CSS__/p_jquery.datetimepicker.css">
<script type="text/javascript" src="__JS__/jquery.datetimepicker.js"></script>
<script type="text/javascript" src="__JS__/20170831/select2.min.js"></script>
<script src="__STATIC__/layer/layer.js"></script>
<script type="text/javascript">
$().ready(function(){
setValue('row','{:I("get.row",10)}');
$("#pagehtml a").on("click",function(event){
event.preventDefault();//使a自带的方法失效即无法调整到href中的URL(http://www.baidu.com)
var geturl = $(this).attr('href');
$('#data_form').attr('action',geturl);
$('#data_form').submit();
});
$('#sdate').datetimepicker({
lang:'ch',
format:'Y-m-d',
formatDate:'Y-m-d',
timepicker:false
});
$('#add').click(function(){
var url = $(this).attr('url');
window.location.href = url;
});
$('.apply').click(function(){
var id = $(this).attr('data-id');
var url = "{:U('apply','','')}"+'/id/'+id;
window.location.href = url;
});
$('.open_edit').click(function(){
var account=$(this).attr('data-account');
var password=$(this).attr('data-password');
var game_name=$(this).attr('data-game_name');
var server_name=$(this).attr('data-server_name');
var role_name=$(this).attr('data-role_name');
var support_id=$(this).attr('data-support_id');
$('#i_account').val(account);
$('#i_password').val(password);
$('#i_game_name').val(game_name);
$('#i_server_name').val(server_name);
$('#i_role_name').val(role_name);
$('#i_support_id').val(support_id);
var id_editor= '.div_editor';
//页面层
layer.open({
type: 1,
title: '新增扶持-修改',
closeBtn: 1,
area: ['600px','580px'],
//skin: 'layui-layer-bgwhite', //白色背景色
shadeClose: true,
content: $(id_editor),
})
});
$('.i_save').click(function () {
var id = $('#i_support_id').val();
var role_name =$('#i_role_name').val();
var user_password = $('#i_password').val();
if(role_name==''){
layer.msg('角色名不能为空');
return false;
}
if(user_password==''){
layer.msg('密码不能为空');
return false;
}
$.ajax({
async: false,
url:"{:U('support_edit')}",
type:"POST",
dataType:"json",
data:{id:id,role_name:role_name,user_password:user_password},
success:function(result){
if(result.status==0){
layer.msg(result.msg,{icon: 2});
}else{
layer.msg('修改成功');
setTimeout(function(){
location.reload();
},1000);
}
},
error:function(){
}
});
});
$('.i_cancel').click(function () {
location.reload();
});
$(".select_gallery").select2();
$('#edate').datetimepicker({
lang:'ch',
format:'Y-m-d',
formatDate:'Y-m-d',
timepicker:false
});
});
</script>
<script type="text/javascript">
$("#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');
var query = $('#form1').find('input').serialize();
query += "&"+$('#form1').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;
});
$("#game_id").change(function(){
$.ajax({
url:"{:U('getServer')}",
type:"post",
data:{game_id:$("#game_id option:selected").attr('game-id')},
dataType:'json',
success:function(data){
console.log(data);
str = "<option value=''>请选择区服</option>";
for (var i in data){
str += "<option value='"+data[i].server_name+"'>"+data[i].server_name+"</option>"
}
$("#server_id").empty();
$("#server_id").append(str);
$("#server_id").select2();
}
})
})
$("#server_js").click(function(event) {
var game_id=$("#game_id").val();
if(game_id==0){
layer.msg('请先选择游戏');
}
});
function webchat_chkkeysend(event)
{
if (event.keyCode==13) {
$('#submit').click();
}
}
</script>
</block>

@ -212,7 +212,7 @@
<tr class="<eq name='mod' value='1'>odd</eq>">
<td>
<label class="checked">
<input class="ids" type="radio" value="{$s['id']}" name="ids[]">
<input class="ids" type="radio" value="{$record.id}" name="role_id">
<i class="check_icon"></i>
</label>
</td>
@ -292,13 +292,20 @@
$('#apply').click(function () {
var title = '添加测试资源申请'
var url = "{:U('TestingResource/apply')}"
var url = "{:U('TestingResource/apply', '', '')}"
var id = $('input[name=role_id]:checked').val()
console.log(id)
id = id == undefined ? 0 : id;
if (id > 0) {
url += '/role_id/' + id
}
layer.open({
title: title,
type: 2,
content: [url , 'no'],
area: ['1000px', '550px'],
area: ['1000px', '600px'],
zIndex: 250,
scrollbar: false,
})

@ -0,0 +1,143 @@
<extend name="Public/basic"/>
<block name="body">
<style>
.trunk-search .form-group {
margin-left: 10px;
}
.normal_table input {
position: relative;
padding: 5px;
border: 1px solid #E5E5E5;
border-radius: 4px;
height: 25px;
}
.normal_table td {
padding: 5px;
}
.normal_table td select {
width: 100%;
}
.normal_table td button {
width: 70px;
height: 35px;
display: block;
background: #409eff;
color: #fff;
border: none;
border-radius: 4px;
cursor: pointer;
}
.normal_table td button.delete-row {
background-color: rgb(249,104,104);
}
.btn-row {
position: relative;
font-size: 11px;
margin-top: 28px;
text-align: center;
}
.btn-row button {
width: 70px;
height: 35px;
display: block;
background: #409eff;
color: #fff;
border: none;
border-radius: 4px;
cursor: pointer;
display: inline-block;
}
.btn-row button.close-btn {
background: #E5E5E5;
color: #535875;
}
.form-group .static-input {
line-height: 32px;
display: inline-block;
}
.trunk-search button {
width: 70px;
height: 35px;
display: block;
background: #409eff;
color: #fff;
border: none;
border-radius: 4px;
cursor: pointer;
display: inline-block;
}
.info-row {
margin-top: 10px;
}
.info-row button {
width: 120px;
height: 25px;
display: block;
background: #E5E5E5;
color: #535875;
border: none;
border-radius: 4px;
cursor: pointer;
display: inline-block;
margin-left: 10px;
}
</style>
<div class="page-search normal_list promoteCoin-record-search" style="padding: 20px;">
<div class="trunk-content article">
<div class="trunk-list list_normal">
<div class="table-wrapper" style="height: 280px;">
<table id="resource-table" class="table normal_table">
<tr class="odd zwm_tr">
<th>申请ID</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="records">
<tr><td colspan="16" 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="records" id="record" mod="2">
<tr data-id="{$record.id}" class="<eq name='mod' value='1'>odd</eq>">
<td>{$record.id}</td>
<td>{$record.create_time}</td>
<td>{$record.game_name}</td>
<td>{$record.server_name}</td>
<td>{$record.role_name}</td>
<td>{$record.user_account}</td>
<td>{$record.user_phone}</td>
<td>{$record.apply_promote_account}</td>
<td>{$record.history_provide_amount}</td>
<td>{$record.apply_amount}</td>
<td>{$record.provide_amount}</td>
<td>{$record.remark}</td>
<td>{$record.verify_status_text}</td>
<td>{$record.status_text}</td>
<td>{$record.provide_status_text}</td>
</tr>
</volist>
</empty>
</table>
</div>
<div class="pagenation clearfix">
{$pagination}
</div>
</div>
</div>
</div>
</block>
<block name="script">
<script type="text/javascript" src="__JS__/20170831/select2.min.js"></script>
<script type="text/javascript">
</script>
</block>

@ -2454,7 +2454,7 @@ CREATE TABLE `tab_testing_resource_order` (
`order_no` varchar(30) NOT NULL COMMENT '订单号',
`ref_id` varchar(30) NOT NULL COMMENT '测试资源ID第三方',
`ref_name` varchar(150) NOT NULL COMMENT '测试资源名称(第三方)',
`num` int(11) NOT NULL DEFAULT 0 COMMENT '申请数量'
`num` int(11) NOT NULL DEFAULT 0 COMMENT '申请数量',
`amount` decimal(12, 2) not null default '0.00' comment '申请金额',
`remark` varchar(255) NOT NULL DEFAULT '' COMMENT '审核备注',
PRIMARY KEY (`id`)
@ -2467,9 +2467,12 @@ CREATE TABLE `tab_testing_resource_batch` (
`user_id` int(11) NOT NULL DEFAULT '0' COMMENT '用户ID',
`server_id` int(11) NOT NULL DEFAULT '0' COMMENT '区服ID',
`role_id` int(11) NOT NULL DEFAULT '0' COMMENT '角色ID',
`amount` decimal(12, 2) not null default '0.00' comment '申请金额',
`status` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '0 待发放 1 已经发放 2 拒绝 3 异常',
`promote_id` int(11) not null default 0 COMMENT '推广员ID',
`role_id` int(11) NOT NULL DEFAULT '0' COMMENT '角色ID',
`apply_amount` decimal(12, 2) not null default '0.00' comment '申请金额',
`provide_amount` decimal(12, 2) not null default '0.00' comment '申请金额',
`provide_status` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '0 待发放 1 已经发放 2 拒绝 3 异常',
`provide_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '审核时间',
`apply_promote_id` int(11) NOT NULL DEFAULT '0' COMMENT '申请推广员ID',
`verify_status` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '0 未审核 1 审核通过 1 未审核通过',
`verify_remark` varchar(255) NOT NULL DEFAULT '' COMMENT '审核备注',
`verify_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '审核时间',

Loading…
Cancel
Save