测试资源配置

master
zhengyongxing 5 years ago
parent 014c7541f3
commit a9ce0585cc

@ -1404,6 +1404,11 @@ class ExportController extends Controller
->where($map)
->order('id DESC')
->select();
foreach ($xlsData as $key => $value) {
checkEncryptionAuth($xlsData[$key]['user_account'],'provide_list');
}
$xlsCell = array(
array('pay_order_number', "订单号"),
array('user_account', "玩家账号"),

@ -104,7 +104,7 @@ class TestResourceController extends ThinkController
$page = set_pagination($count,$row);
if($page) {$this->assign('_page', $page);}
$this->meta_title = '扶持号管理';
$this->meta_title = '资源管理';
$this->assign('data',$data);
$show_data_power = (is_administrator()|| session('user_auth')['show_data']);
$this->assign('show_data_power', $show_data_power);
@ -120,34 +120,39 @@ class TestResourceController extends ThinkController
$this->error('请选择资源后再进行操作');
}
$resourceData = M('test_resource','tab_')
->field("promote_id")
->where(['id'=>['in',$id]])
->select();
$resourceData = array_column($resourceData,'promote_id');
$promoteId = [];
if (!I('status','')&&I('status','')!='0') {
$this->error('请选择状态后在进行操作');
}
foreach ($resourceData as $key => $value) {
// $resourceData = M('test_resource','tab_')
// ->field("promote_id")
// ->where(['id'=>['in',$id]])
// ->select();
//
// $resourceData = array_column($resourceData,'promote_id');
$promoteData = M('promote','tab_')
->field('id')
->where("chain like '%/{$value}/%' or id = {$value}")
->select();
$promoteId = array_merge($promoteData, $promoteId);
}
// $promoteId = [];
//
// foreach ($resourceData as $key => $value) {
//
// $promoteData = M('promote','tab_')
// ->field('id')
// ->where("chain like '%/{$value}/%' or id = {$value}")
// ->select();
// $promoteId = array_merge($promoteData, $promoteId);
// }
$promoteId = implode(',',array_column($promoteId,'id'));
// $promoteId = array_unique($resourceData);
// var_dump($promoteId);die();
$testResource = M('test_resource','tab_')
->field("user_id")
->where(['promote_id'=>['in',$promoteId]])
->where(['id'=>['in',$id]])
->group('user_id')
->select();
$data = [
'lock_status' => 0
'lock_status' => I('status','')
];
$user_id = implode(',',array_column($testResource,'user_id'));
@ -156,11 +161,11 @@ class TestResourceController extends ThinkController
if ($isFreeze) {
$this->success('冻结成功',U('index'));
$this->success('操作成功',U('supportNumberList'));
} else {
$this->error('冻结失败',U('index'));
$this->error('操作失败',U('supportNumberList'));
}

@ -110,7 +110,7 @@
<a class="fr" id="batch_add"><span class="button_icon button_icon9"></span>批量申请后续</a>
<a class="fr" href="{:U('add?model='.$model['id'])}"><span class="button_icon button_icon1"></span>新增测试账号</a>
<a class="fr" id="batch_freeze"><span class="button_icon button_icon5 "></span>批量锁定</a>
<!-- <a class="fr" id="batch_freeze"><span class="button_icon button_icon5 "></span>批量锁定</a>-->
</empty>
</div>
</div>

@ -84,7 +84,20 @@
<div class="input-list">
<a class="sch-btn" href="javascript:;" id="search" url="{:U('TestResource/supportNumberList','model='.$model['name'] .'&row='.I('row'),false)}">搜索</a>
</div>
<div class="input-list button_list" style="margin-left: 120px">
<div class="tools">
<empty name="show_status">
<a class="fr" id="batch_unfreeze"><span class="button_icon button_icon9"></span>批量开启</a>
<!-- <a class="fr" href="{:U('add?model='.$model['id'])}"><span class="button_icon button_icon1"></span>新增测试账号</a>-->
<a class="fl" id="batch_freeze"><span class="button_icon button_icon5 "></span>批量锁定</a>
</empty>
</div>
</div>
</div>
</div>
<!-- 数据列表 -->
<div class="data_list">
@ -94,6 +107,9 @@
<!-- 表头 -->
<thead>
<tr>
<th>
<input class="check-all" type="checkbox">
</th>
<th>产品名称</th>
<th>区服</th>
<th>测试账号</th>
@ -116,6 +132,7 @@
<notemtpy name = "data">
<volist name="data" id="s">
<tr data-id="{$s.user_id}">
<td><input class="ids" type="checkbox" value="{$s['id']}" name="ids[]" ></td>
<td>{$s.game_name}</td>
<td>{$s.server_name}</td>
<td>{$s.user_account}</td>
@ -204,6 +221,66 @@
}
})
$('#batch_freeze').click(function () {
var ids = $('.ids:checked');
if (ids.length > 0) {
var str = new Array();
ids.each(function () {
str.push($(this).val());
});
param = str.join(',');
} else {
layer.msg('请选择要操作的数据',{skin:'textColor'});
return false;
}
var url = "{:U('batchFreeze','','')}" + '/id/' + param + '/status/0';
layer.confirm('是否冻结选中推广员下的资源账号?', {
title:'冻结资源账号',
icon:3,
skin:'textColor',
btn: ['冻结','取消'] //按钮
}, function(){
window.location.href = url;
}, function(){
layer.close();
});
});
$('#batch_unfreeze').click(function () {
var ids = $('.ids:checked');
if (ids.length > 0) {
var str = new Array();
ids.each(function () {
str.push($(this).val());
});
param = str.join(',');
} else {
layer.msg('请选择要操作的数据',{skin:'textColor'});
return false;
}
var url = "{:U('batchFreeze','','')}" + '/id/' + param + '/status/1';
layer.confirm('是否冻结选中推广员下的资源账号?', {
title:'冻结资源账号',
icon:3,
skin:'textColor',
btn: ['冻结','取消'] //按钮
}, function(){
window.location.href = url;
}, function(){
layer.close();
});
});
$('.unfroze-btn').on({
click: function() {
var id = $(this).parents('tr').eq(0).attr('data-id')
@ -485,6 +562,8 @@
window.location.href = url;
});
</script>
<style>
.textColor .layui-layer-content{color: #000000;}

Loading…
Cancel
Save