master
ELF 4 years ago
parent 49751b8760
commit c0fe59864c

@ -833,7 +833,15 @@ function Status_recovery($msg){
if (empty($str)) {return $title;}
$find = array('%webname%','%gamename%','%newsname%','%giftname%','%gametype%', '%catetitle%', '%gamedevice%');
$replace = array($title,$array['game_name'],$array['news_title'],$array['giftbag_name'],$array['game_type_name'],$array['cate_title'],$array['game_device']);
$replace = array(
$title,
$array['game_name'] ?? '',
$array['news_title'] ?? '',
$array['giftbag_name'] ?? '',
$array['game_type_name'] ?? '',
$array['cate_title'] ?? '',
$array['game_device'] ?? ''
);
$str = str_replace($find,$replace,$str);
return preg_replace('/((-|_)+)?((%[0-9A-Za-z_]*%)|%+)((-|_)+)?/','',$str);

@ -23,7 +23,6 @@ class TestingResourceController extends BaseController
$conditions = [];
$subConditions = [
'_string' => 'user_id = tab_user_play_info.user_id',
'promote_id' => $loginPromote['id'],
];
@ -34,8 +33,8 @@ class TestingResourceController extends BaseController
$subConditions['create_time'] = ['elt', strtotime($createTimeEnd . ' 23:59:59')];
}
$subSql = M('testing_user', 'tab_')->field(['1'])->where($subConditions)->select(false);
$strCondition = 'exists (' . $subSql . ')';
$subSql = M('testing_user', 'tab_')->field(['user_id'])->where($subConditions)->select(false);
$strCondition = 'user_id in (' . $subSql . ')';
if ($account) {
$user = M('user', 'tab_')->field(['id'])->where('account like ' . $account . '%')->find();
@ -69,7 +68,7 @@ class TestingResourceController extends BaseController
if (count($roles) > 0) {
$users = M('user', 'tab_')->field(['id', 'phone'])->where(['id' => ['in', $userIds]])->select();
$uesrs = index_by_column('id', $users);
$bindings = M('testing_binding', 'tab_')->field()->where(['role_id' => ['in', $roleIds]])->select();
$bindings = M('testing_binding', 'tab_')->where(['role_id' => ['in', $roleIds]])->select();
$bindings = index_by_column('role_id', $bindings);
$bindingRoleIds = array_column($bindings, 'bind_role_id');
if (count($bindings) > 0) {
@ -115,12 +114,13 @@ class TestingResourceController extends BaseController
{
$loginPromote = $this->getLoginPromote();
$accountsStr = trim(I('accounts', ''), ',');
if ($accountsStr = '') {
if ($accountsStr == '') {
return $this->ajaxReturn(['status' => 0, 'message' => '请输入测试资源账号']);
}
$accounts = explode(',', $accountsStr);
$accounts = array_unique($accounts);
$existAccounts = M('testing_user', 'tab_')->where(['user_account' => ['in', $accounts]])->getField('user_account', true);
$existAccounts = $existAccounts ?? [];
$existCount = count($existAccounts);
$newAccounts = array_diff($accounts, $existAccounts);
$errorCount = 0;
@ -145,7 +145,7 @@ class TestingResourceController extends BaseController
$successCount ++;
}
}
return $this->ajaxReturn(['status' => 1, 'message' => '请输入测试资源账号', 'data' => [
return $this->ajaxReturn(['status' => 1, 'message' => '请求成功', 'data' => [
'errorCount' => $errorCount,
'successCount' => $successCount,
'existCount' => $existCount,
@ -196,6 +196,15 @@ class TestingResourceController extends BaseController
}
public function apply()
{
$records = [];
$pagination = '';
$this->assign('records', $records);
$this->assign('pagination', $pagination);
$this->display();
}
public function doApply()
{
$records = I('records', []);
$batchNo = '';

@ -0,0 +1,96 @@
<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;
}
.normal_table td button.danger-btn {
background-color: rgb(249,104,104);
}
</style>
<div class="page-search normal_list promoteCoin-record-search" style="padding: 20px;">
<div class="trunk-content article">
<div class="trunk-search clearfix" style="margin-bottom: 10px;">
<form action="{:U('PromoteCoin/subPromotes', array('row'=>I('get.row')))}" method="post" class="clearfix">
<input type="hidden" name="level" value="{:I('level', 0)}">
<div class="form-group normal_space fr">
<input type="submit" class="submit" value="查询">
</div>
<div class="form-group fr">
<label class="form-title select-title">手机号:</label>
<input type="text" name="mobile" class="txt normal_txt" id="uid" placeholder="手机号" value="{:I('mobile')}">
</div>
<div class="form-group fr">
<label class="form-title select-title">账号:</label>
<input type="text" name="account" class="txt normal_txt" id="uid" placeholder="账号" value="{:I('account')}">
</div>
</form>
</div>
<div class="trunk-list list_normal">
<table class="table normal_table">
<tr>
<th width="150">资源类型</th>
<th width="150">资源内容</th>
<th>资源价值</th>
<th>资源数量</th>
<th>备注</th>
<th>+</th>
<th>-</th>
</tr>
<tr>
<td><select name="" class="select_gallery"><option value="">请选择</option></select></td>
<td><select name="" class="select_gallery"><option value="">请选择</option></select></td>
<td>198</td>
<td><input type="text"></td>
<td><input type="text"></td>
<td><button type="button">增加</button></td>
<td><button type="button" class="danger-btn">删除</button></td>
</tr>
</empty>
</table>
<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">
$(".select_gallery").select2();
$('.select-user').on({
click: function() {
var tr = $(this).parents('tr').eq(0)
var id = tr.attr('data-id')
var account = tr.find('.item-account').html()
var mobile = tr.find('.item-mobile').html()
var realName = tr.find('.item-real_name').html()
parent.choiceUser(id, account, realName)
}
})
</script>
</block>

@ -156,7 +156,7 @@
<br>
<br>
<div class="form-group normal_space fr">
<input type="button" class="submit" id='batch_add'
<input type="button" class="submit" id='apply'
style="width: 100px;text-align: center;background:rgb(249,104,104);cursor:pointer;"
value="批量申请后续">
</div>
@ -259,7 +259,7 @@
</div>
<div class="form-group">
<label></label>
<a id="shift-player-submit" href="javascript:;" class="add-submit btn">确定</a>
<a id="add-submit" href="javascript:;" class="add-submit btn">确定</a>
</div>
</form>
</div>
@ -293,19 +293,36 @@
timepicker: false
});
$('#apply').click(function () {
var title = '添加测试资源申请'
var url = "{:U('TestingResource/apply')}"
layer.open({
title: title,
type: 2,
content: [url , 'no'],
area: ['1000px', '550px'],
zIndex: 250,
scrollbar: false,
})
})
$('#add').click(function () {
var box = $('#add-box')
layer.open({
title: '新增测试账号',
type: 1,
content: box,
area: ['600px', '330px'],
area: ['800px', '330px'],
zIndex: 250,
})
});
$('#add-submit').on({
click: function () {
var box = $('#add-box')
var accounts = box.find('[name=accounts]').val()
console.log(accounts)
$.ajax({
async: false,
url: "{:U('addTestingUsers')}",
@ -314,12 +331,18 @@
data: { accounts: accounts },
success: function (result) {
if (result.status == 0) {
layer.msg(result.msg);
layer.msg(result.message);
} else {
layer.msg('修改成功');
setTimeout(function () {
var message = '成功' + result.data.successCount + '个, 失败' + result.data.errorCount + '个, 已存在' + result.data.existCount + '个。'
layer.confirm(message, {
btn: ['确定'] //按钮
}, function(){
location.reload();
})
// layer.msg(result.message);
/* setTimeout(function () {
location.reload();
}, 1000);
}, 1000); */
}
},
error: function () {

Loading…
Cancel
Save