master
elf 3 years ago
parent c35223b3a2
commit 6b7276c344

@ -257,10 +257,17 @@ class GameRebateController extends ThinkController
$this->assign('baseGames', $baseGames);
$this->assign('reviewStatusList', []);
$this->assign('records', $records);
$this->display('records');
$this->display('simulateSpendList');
}
public function addSimulateSpend()
{
$baseGames = M('base_game', 'tab_')->select();
$this->assign('baseGames', $baseGames);
$this->display('simulateSpendForm');
}
public function saveSimulateSpend()
{
$params = I('post.');
try {

@ -111,13 +111,32 @@ body {
color: #fff;
}
.form-group {
float: left;
margin-bottom: 10px;
}
.form-group label {
width: 100px;
display: inline-block;
text-align: right;
margin-right: 10px;
vertical-align: middle;
}
.form-group input {
padding: 5px;
border: 1px solid #E5E5E5;
border-radius: 4px;
height: 24px;
width: 280px;
}
.form-group .static-input {
width: 280px;
}
.form-group select {
width: 280px;
}
.form-group textarea {
padding: 5px;
border: 1px solid #E5E5E5;
border-radius: 4px;
}
.clearfix:after {
content: "\20";
@ -140,17 +159,19 @@ body {
<form method="post" class="clearfix">
<div class="clearfix">
<div class="form-group">
<select id="game-select" name="" class="select_gallery" style="width:150px" <?php if($role):?>disabled<?php endif;?>>
<label>游戏名称</label>
<select id="game-select" name="" class="select_gallery" <?php if($role):?>disabled<?php endif;?>>
<option value="0">请选择游戏</option>
<?php foreach($baseGames as $game):?>
<option value="<?=$game['id']?>" <?php if($role && $role['game_id'] == $game['id']):?>selected<?php endif;?>>
<?=$game['game_name']?>
<?=$game['name']?>
</option>
<?php endforeach;?>
</select>
</div>
<div class="form-group">
<select id="server-select" class="select_gallery" style="width:150px" <?php if($role):?>disabled<?php endif;?>>
<label>区服</label>
<select id="server-select" class="select_gallery" <?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;?>>
@ -160,10 +181,8 @@ body {
</select>
</div>
<div class="form-group">
<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">
<select id="role-select" name="role_id" class="select_gallery" style="width:150px" <?php if($role):?>disabled<?php endif;?>>
<label>角色</label>
<select id="role-select" name="role_id" class="select_gallery" <?php if($role):?>disabled<?php endif;?>>
<option value="">请选择角色</option>
<?php if($role):?>
<option value="<?=$role['role_id']?>" selected><?=$role['role_name']?></option>
@ -172,26 +191,32 @@ body {
</div>
</div>
<div class="clearfix" style="margin-top: 10px;">
<div class="form-group fl">
<div class="form-group">
<label>角色名称</label>
<p class="static-input">角色名称: --</p>
</div>
<div class="form-group fl">
<div class="form-group">
<label>当前累充</label>
<p class="static-input">当前累充: --</p>
</div>
<div class="form-group fl">
<div class="form-group">
<label>模拟发放金额</label>
<input type="text" name="amount" class="txt normal_txt" placeholder="请输入模拟发放金额" value="">
</div>
<div class="form-group fl">
<input type="text" name="remark" class="txt normal_txt" placeholder="请输入备注" value="">
<div class="form-group">
<label>备注</label>
<textarea name="remark" class="txt normal_txt" style="width: 280px;" rows="10" placeholder="请输入备注"></textarea>
<!-- <input type="text" name="remark" class="txt normal_txt" placeholder="请输入备注" value=""> -->
</div>
<div class="form-group fl">
<div class="form-group">
<label></label>
<button id="add-row" class="add-row" type="button">增加</button>
</div>
</div>
</form>
</div>
</div>
</div>>
</div>
</div>
<script type="text/javascript">

@ -167,6 +167,7 @@
<div class="butnlist jscheckbutn" style="margin-left: 2px">
<a class="butn" id="review-agree-btn">审批通过</a>
<a class="butn" id="review-refuse-btn" style="background-color: red;">审核拒绝</a>
<a class="butn" id="add-btn">添加</a>
</div>
</div>
@ -385,6 +386,19 @@
})
return ids;
}
$('#add-btn').click(function () {
var title = '添加模拟充值'
var url = "{:U('GameRebate/addSimulateSpend', '', '')}"
layer.open({
title: title,
type: 2,
content: [url , 'no'],
area: ['500px', '600px'],
zIndex: 250,
scrollbar: false,
})
})
});
$(".export-btn").on("click",function(e){
e.preventDefault();

@ -310,7 +310,7 @@ class GameRebateService
return $fields;
}
public function addSimulateSpend($params, $handler = null)
public function addSimulateSpend($params, $handler)
{
$baseGameId = $params['base_game_id'] ?? 0;
$roleId = $params['role_id'] ?? '';
@ -335,6 +335,7 @@ class GameRebateService
if ($role == null) {
throw new \Exception('角色不存在');
}
$data = [
'user_id' => $role['user_id'],
'user_account' => $role['user_account'],
@ -344,10 +345,12 @@ class GameRebateService
'role_name' => $role['role_name'],
'server_id' => $role['server_id'],
'server_name' => $role['server_name'],
'order_no' => '',
'order_no' => 'SS_' . date('YmdHis') . getRandomPassword(4),
'create_time' => time(),
'amount' => $amount,
'remark' => $remark
'remark' => $remark,
'creator_id' => $handler['id'],
'creator_username' => $handler['username'],
];
M('simulate_spend', 'tab_')->add($data);

@ -3062,4 +3062,32 @@ function getAggExceptIds($gameSettings)
function getHideAccount($account)
{
return substr($account, 0, 2) . '******' . substr($account, 8);
}
function getRandomPassword($length, $special = false){
$chars = array(
'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k',
'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v',
'w', 'x', 'y', 'z', 'A', 'B', 'C', 'D', 'E', 'F', 'G',
'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R',
'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', '0', '1', '2',
'3', '4', '5', '6', '7', '8', '9'
);
if($special){
$chars = array_merge($chars, array(
'!', '@', '#', '$', '?', '|', '{', '/', ':', ';',
'%', '^', '&', '*', '(', ')', '-', '_', '[', ']',
'}', '<', '>', '~', '+', '=', ',', '.'
));
}
$charsLen = count($chars) - 1;
shuffle($chars);
$password = '';
for($i=0; $i<$length; $i++){
$password .= $chars[mt_rand(0, $charsLen)];
}
return $password;
}

@ -2920,4 +2920,27 @@ update tab_rebate_orders set current_award_date = FROM_UNIXTIME(UNIX_TIMESTAMP(n
ALTER TABLE tab_rebate_orders add column `review_type` tinyint(1) not null DEFAULT 0 COMMENT '0 管理员 1 推广员 2 系统自动' after reviewer_username;
ALTER TABLE tab_promote add column `rebate_over_perm` tinyint(1) not null DEFAULT 0 COMMENT '是否开启推广后台返利管理权限' after shift_over_apply;
ALTER TABLE tab_promote add column `rebate_over_perm` tinyint(1) not null DEFAULT 0 COMMENT '是否开启推广后台返利管理权限' after shift_over_apply;
CREATE TABLE `tab_simulate_spend` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`base_game_id` int(11) unsigned NOT NULL COMMENT '游戏id',
`base_game_name` varchar(50) NOT NULL COMMENT '游戏名称',
`user_id` int(11) NOT NULL DEFAULT '0' COMMENT '用户ID',
`user_account` varchar(30) DEFAULT '' COMMENT '用户账号',
`server_id` varchar(30) DEFAULT '' COMMENT '区服名称',
`server_name` varchar(30) DEFAULT '' COMMENT '区服名称',
`role_name` varchar(100) DEFAULT '' COMMENT '游戏玩家昵称',
`role_id` varchar(50) NOT NULL DEFAULT '' COMMENT '角色ID',
`order_no` varchar(50) NOT NULL DEFAULT '' COMMENT '订单号',
`amount` int(11) NOT NULL DEFAULT '0' COMMENT '模拟充值金额',
`status` tinyint(1) not null DEFAULT 0 COMMENT '审核状态 0 未审核 1 审核通过 2 审核拒绝',
`review_time` int(11) not null DEFAULT 0 COMMENT '审核时间',
`reviewer_id` int(11) not null DEFAULT 0 COMMENT '审核人ID',
`reviewer_username` varchar(20) not null DEFAULT '' COMMENT '审核人用户名',
`creator_id` int(11) not null DEFAULT 0 COMMENT '创建人ID',
`creator_username` varchar(20) not null DEFAULT '' COMMENT '创建人用户名',
`remark` varchar(255) not null DEFAULT '' COMMENT '备注',
`create_time` int(11) NOT NULL DEFAULT 0 COMMENT '生成时间',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='返利模拟充值表';
Loading…
Cancel
Save