测试资源批量封号

master
zhengyongxing 5 years ago
parent 4d938b85f4
commit e60b9b2edf

@ -112,6 +112,60 @@ class TestResourceController extends ThinkController
}
public function batchFreeze() {
if (I('id','')) {
$id =I('id','');
} else {
$this->error('请选择资源后再进行操作');
}
$resourceData = M('test_resource','tab_')
->field("promote_id")
->where(['id'=>['in',$id]])
->select();
$resourceData = array_column($resourceData,'promote_id');
$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'));
$testResource = M('test_resource','tab_')
->field("user_id")
->where(['promote_id'=>['in',$promoteId]])
->group('user_id')
->select();
$data = [
'lock_status' => 0
];
$user_id = implode(',',array_column($testResource,'user_id'));
$isFreeze = M('user','tab_')->where(['id'=>['in',$user_id]])->save($data);
if ($isFreeze) {
$this->success('冻结成功',U('index'));
} else {
$this->error('冻结失败',U('index'));
}
}
public function freezeSupport() {
$supportId = I('support_id', 0);
if ($supportId == 0) {

@ -92,8 +92,10 @@
<div class="fl button_list" style="width:100%;">
<div class="tools">
<empty name="show_status">
<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>
</empty>
</div>
</div>
@ -471,6 +473,35 @@
window.location.href = url;
});
$('#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;
layer.confirm('是否冻结整个渠道链的资源账号?', {
title:'冻结该渠道',
icon:0,
btn: ['删除','取消'] //按钮
}, function(){
window.location.href = url;
}, function(){
layer.close();
});
});
</script>
<style>
.textColor .layui-layer-content{color: #ffffff;background:#000; opacity: 0.8;text-align: center}

@ -1469,6 +1469,44 @@ ALTER TABLE `tab_spend`
ADD INDEX `pay_channel`(`pay_way`, `pay_status`, `game_id`) USING BTREE,
ADD INDEX `pay_channel_type`(`pay_status`, `pay_way`) USING BTREE;
-- 2020-03-06 liaojinling
CREATE TABLE `tab_user_data` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`user_id` int(11) not null COMMENT '用户ID',
`pay_amount` decimal(12, 2) not null DEFAULT '0.00' COMMENT '累计支付金额',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='用户数据表';
CREATE TABLE `tab_game_data` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`game_id` int(11) not null COMMENT '游戏ID',
`pay_amount` decimal(12, 2) not null DEFAULT '0.00' COMMENT '累计充值金额',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='游戏数据表';
CREATE TABLE `tab_base_game` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(150) not null COMMENT '游戏名称',
`android_game_id` int(11) not null default 0 COMMENT 'android版ID',
`ios_game_id` int(11) not null default 0 COMMENT 'ios版ID',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='用户数据表';
ALTER TABLE `tab_spend`
ADD INDEX `index_user_id`(`user_id`) USING BTREE;
CREATE TABLE `tab_package_download_log` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`promote_id` int(11) not null COMMENT '推广员ID',
`game_id` int(11) not null COMMENT '游戏ID',
`user_id` int(11) not null default 0 COMMENT '用户ID',
`type` tinyint(1) not null default 0 COMMENT '类型 1 企业签下载 2 TF下载 3 超级签下载',
`create_time` int(11) NULL DEFAULT 0 COMMENT '创建时间',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='包下载记录表';
update tab_quick_menu set url='/index.php?s=/Home/Game/index.html' where url='/index.php?s=/Home/Apply/index.html';
-- 2020-03-16 zyx 添加ip限制白名单表内购tool表状态配置列
INSERT INTO `tab_tool`(`name`, `title`, `config`, `template`, `type`, `status`, `create_time`) VALUES ('apple_interior_buy', '苹果内购通知开启', NULL, NULL, 1, 0, 1584345308);
CREATE TABLE `tab_forbit_ip` (
@ -1570,3 +1608,5 @@ CREATE TABLE `tab_finance_compare_info` (
-- zyx 20200420
ALTER TABLE `platform`.`sys_auth_rule`
MODIFY COLUMN `title` varchar(80) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '规则中文描述' AFTER `name`;
ALTER TABLE `sj_game_user`.`sj_user`
ADD COLUMN `platform_account` varchar(60) NULL COMMENT '游戏渠道玩家账号' AFTER `age_type`;
Loading…
Cancel
Save