修改bug

master
yulingwei 5 years ago
parent 917b88af21
commit 046beee6be

@ -578,4 +578,10 @@ function arrayPromoteWithdrawStatus($status, $param, $array = array()) {
} }
} }
return $array; return $array;
}
function getAllGame()
{
$list = M("game", 'tab_')->field('relation_game_name as game_name')->group('relation_game_name')->select();
return $list;
} }

@ -88,7 +88,7 @@ class AjaxController extends ThinkController{
if ($game) { if ($game) {
$map['game_id'] = ['in', $game]; $map['game_id'] = ['in', $game];
} }
$data = M('Server', 'tab_')->field('id, server_name, server_id')->where($map)->select(); $data = M('Server', 'tab_')->field('id, server_name, server_id')->where($map)->group('server_name')->select();
$this->AjaxReturn($data); $this->AjaxReturn($data);
} }

@ -88,4 +88,43 @@ class ConsoleController extends Think {
} }
} }
} }
/**
* 登录校验
*/
public function modifyLogin()
{
$start_time = 1569686400;
$current_time = strtotime(date("Y-m-d"));
for ($i=$start_time; $i<=$current_time; $i+=86400) {
$end_time = $i+86400;
$result = M()->query("SELECT
game_id,
FROM_UNIXTIME(login_time, '%Y-%m-%d') create_time,
user_id,
promote_id
FROM
tab_user_login_record
WHERE
login_time >= {$i} and login_time < {$end_time}
GROUP BY
create_time,
game_id,
user_id");
if ($result) {
foreach ($result as $index => $item) {
$item['create_time'] = strtotime($item['create_time']);
if ($item['create_time']) {
$res = M("login_daily_record", "tab_")->add($item);
echo "写入{$item['create_time']} $res \n";
} else {
echo "写入{$item['create_time']} error \n";
}
unset($result[$index]);
}
} else {
echo "写入{$item['create_time']} 无 \n";
}
}
}
} }

@ -46,6 +46,9 @@ class GameSourceController extends ThinkController
if (empty($_POST['game_id'])) { if (empty($_POST['game_id'])) {
$this -> error('游戏名称不能为空'); $this -> error('游戏名称不能为空');
} }
if (empty($_POST['remark'])) {
$this->error("请填写更新说明");
}
$game = M('Game', 'tab_') -> where(array('id' => $_POST['game_id'])) -> find(); $game = M('Game', 'tab_') -> where(array('id' => $_POST['game_id'])) -> find();
$_POST['game_name'] = $game['game_name']; $_POST['game_name'] = $game['game_name'];
if (empty($_POST['file_name'])) { if (empty($_POST['file_name'])) {
@ -140,6 +143,9 @@ class GameSourceController extends ThinkController
$this -> error('游戏原包格式不正确'); $this -> error('游戏原包格式不正确');
} }
} }
if (empty($_POST['remark'])) {
$this->error("请填写更新说明");
}
$map['file_type'] = $_POST['file_type']; $map['file_type'] = $_POST['file_type'];
$d = D('Game_source') -> where($map) -> find(); $d = D('Game_source') -> where($map) -> find();
$source = A('Source', 'Event'); $source = A('Source', 'Event');

@ -237,7 +237,7 @@ class MemberController extends ThinkController
$this->m_title = '玩家列表'; $this->m_title = '玩家列表';
$this->assign('commonset', M('Kuaijieicon')->where(['url' => 'Member/user_info', 'status' => 1])->find()); $this->assign('commonset', M('Kuaijieicon')->where(['url' => 'Member/user_info', 'status' => 1])->find());
$this->display(); $this->display();
} }
@ -445,6 +445,14 @@ class MemberController extends ThinkController
if (empty($data['password'])) { if (empty($data['password'])) {
unset($data['password']); unset($data['password']);
} }
if (!empty($data['real_name']) && (\mb_strlen($data['real_name']) > 5 || \mb_strlen($data['real_name']) <= 1)) {
$this->error('请填写正确的名字');
}
if (!empty($data['idcard']) && !preg_match('/^[1-9]\d{7}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}$|^[1-9]\d{5}[1-9]\d{3}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}([0-9]|X)$/', $data['idcard'])) {
$this->error('请输入正确的身份证号码');
}
$res = $member->updateInfo($data); $res = $member->updateInfo($data);
if ($res !== false) { if ($res !== false) {
\Think\Log::actionLog("Member/edit", "Member", $id); \Think\Log::actionLog("Member/edit", "Member", $id);

@ -129,7 +129,7 @@
<tr> <tr>
<td class="l">更新说明:</td> <td class="l">更新说明:</td>
<td class="r" > <td class="r" >
<textarea name="remark" class="txt_area">{$data.remark}</textarea> <textarea name="remark" class="txt_area" required>{$data.remark}</textarea>
</td> </td>
</tr> </tr>
</tbody> </tbody>

@ -104,9 +104,9 @@
<td class="l">真实姓名</td> <td class="l">真实姓名</td>
<td class="r"> <td class="r">
<if condition="$data['real_name'] eq null"> <if condition="$data['real_name'] eq null">
<input type="text" class="txt" name="real_name" value="" disabled> <input type="text" class="txt" name="real_name" value="">
<else/> <else/>
<input type="text" class="txt" name="real_name" value="{$data['real_name']}" disabled> <input type="text" class="txt" name="real_name" value="{$data['real_name']}">
</if> </if>
</td> </td>
</tr> </tr>
@ -114,9 +114,9 @@
<td class="l">身份证号</td> <td class="l">身份证号</td>
<td class="r"> <td class="r">
<if condition="$data['idcard'] eq null"> <if condition="$data['idcard'] eq null">
<input type="text" class="txt" name="idcard" value="" disabled> <input type="text" class="txt" name="idcard" value="">
<else/> <else/>
<input type="text" class="txt" name="idcard" value="{$data['idcard']}" disabled> <input type="text" class="txt" name="idcard" value="{$data['idcard']}">
</if> </if>
</td> </td>
</tr> </tr>

@ -67,19 +67,19 @@
<span class="add-on"><i class="icon-th"></i></span> <span class="add-on"><i class="icon-th"></i></span>
</div> </div>
</div> </div>
<div class="input-list input-list-game search_label_rehab">
<select id="game_type" name="game_type" class="select_gallery" >
<option value="">设备类型</option>
<option value="1">安卓</option>
<option value="2">苹果</option>
</select>
</div>
<div class="input-list input-list-game search_label_rehab"> <div class="input-list input-list-game search_label_rehab">
<select id="game_name" name="game_name" class="select_gallery" > <select id="game_name" name="game_name" class="select_gallery" >
<option value="">游戏名称</option> <option value="">游戏名称</option>
<!-- <volist name=":get_game_list(null, $_GET['game_type'])" id="vo"> <volist name=":getAllGame()" id="vo">
<option game-id="{$vo.id}" value="{$vo.id}">{$vo.game_name}</option> <option value="{$vo.game_name}" <?php echo $vo.relation_game_name == I('game_name') ? 'selected':''; ?> >{$vo.game_name}</option>
</volist> --> </volist>
</select>
</div>
<div class="input-list input-list-game search_label_rehab">
<select id="game_type" name="game_type" class="select_gallery" >
<option value="">设备类型</option>
<option value="1" <?php echo I('game_type') == 1 ? "selected" : ''?>>安卓</option>
<option value="2" <?php echo I('game_type') == 2 ? "selected" : ''?>>苹果</option>
</select> </select>
</div> </div>
<div class="input-list input-list-server search_label_rehab"> <div class="input-list input-list-server search_label_rehab">
@ -253,34 +253,8 @@
}) })
}); });
var game_name = "{:I('game_name')}";
$("#game_type").change(function(){
$.ajax({
url:"{:U('Ajax/getGameList')}",
type:"get",
data:{sdk_type:$("#game_type option:selected").val()},
dataType:'json',
success:function(response){
str = '<option value="">游戏名称</option>';
// $.each(response.data, function(index, item){
// console.log(item.id);
// str += '<option value="'+item.id+' '+(promote_id && item.id == promote_id?'selected':'')+'">'+item.nickname+'</option>';
// });
data = response.data;
for (var i in data){
str += "<option value='"+data[i].relation_game_name+"' "+(game_name && data[i].relation_game_name == game_name?'selected':'')+">"+data[i].relation_game_name+"</option>"
}
$("#game_name").empty();
$("#game_name").append(str);
$("#game_name").select2();
$("#game_name").change();
}
})
});
$("#game_type").change();
var game_server = "{:I('server_name')}"; var game_server = "{:I('server_name')}";
$("#game_name").change(function(){ $("#game_type").change(function(){
$.ajax({ $.ajax({
url:"{:U('Ajax/getGmeServer')}", url:"{:U('Ajax/getGmeServer')}",
type:"post", type:"post",
@ -298,6 +272,10 @@
}) })
}); });
$("#game_name").change(function(){
$("#game_type").change();
});
$("#game_name").change();
}) })
</script> </script>
</block> </block>

@ -116,18 +116,18 @@
</select> </select>
</div> </div>
<div class="input-list input-list-game search_label_rehab"> <div class="input-list input-list-game search_label_rehab">
<select id="game_type" name="game_type" class="select_gallery" > <select id="game_name" name="game_name" class="select_gallery" >
<option value="">设备类型</option> <option value="">游戏名称</option>
<option value="1">安卓</option> <volist name=":getAllGame()" id="vo">
<option value="2">苹果</option> <option value="{$vo.game_name}" <?php echo $vo.relation_game_name == I('game_name') ? 'selected':''; ?> >{$vo.game_name}</option>
</volist>
</select> </select>
</div> </div>
<div class="input-list input-list-game search_label_rehab"> <div class="input-list input-list-game search_label_rehab">
<select id="game_name" name="game_name" class="select_gallery" > <select id="game_type" name="game_type" class="select_gallery" >
<option value="">游戏名称</option> <option value="">设备类型</option>
<!-- <volist name=":get_game_list(null, $_GET['game_type'])" id="vo"> <option value="1" <?php echo I('game_type') == 1 ? "selected" : ''?>>安卓</option>
<option game-id="{$vo.id}" value="{$vo.id}">{$vo.game_name}</option> <option value="2" <?php echo I('game_type') == 2 ? "selected" : ''?>>苹果</option>
</volist> -->
</select> </select>
</div> </div>
<div class="input-list input-list-server search_label_rehab"> <div class="input-list input-list-server search_label_rehab">
@ -452,34 +452,8 @@ $(function(){
}); });
$("#promote_level").change(); $("#promote_level").change();
}) })
var game_name = "{:I('game_name')}"; var game_server = "{:I('server_name')}";
$("#game_type").change(function(){ $("#game_type").change(function(){
$.ajax({
url:"{:U('Ajax/getGameList')}",
type:"get",
data:{sdk_type:$("#game_type option:selected").val()},
dataType:'json',
success:function(response){
str = '<option value="">游戏名称</option>';
// $.each(response.data, function(index, item){
// console.log(item.id);
// str += '<option value="'+item.id+' '+(promote_id && item.id == promote_id?'selected':'')+'">'+item.nickname+'</option>';
// });
data = response.data;
for (var i in data){
str += "<option value='"+data[i].relation_game_name+"' "+(game_name && data[i].relation_game_name == game_name?'selected':'')+">"+data[i].relation_game_name+"</option>"
}
$("#game_name").empty();
$("#game_name").append(str);
$("#game_name").select2();
$("#game_name").change();
}
})
});
$("#game_type").change();
var game_server = "{:I('server_name')}";
$("#game_name").change(function(){
$.ajax({ $.ajax({
url:"{:U('Ajax/getGmeServer')}", url:"{:U('Ajax/getGmeServer')}",
type:"post", type:"post",
@ -497,6 +471,12 @@ $(function(){
}) })
}); });
$("#game_name").change(function(){
$("#game_type").change();
});
$("#game_name").change();
function shenhe(status){ function shenhe(status){
var text = $("input:checkbox[name='ids[]']:checked").map(function(index,elem) { var text = $("input:checkbox[name='ids[]']:checked").map(function(index,elem) {
return $(elem).val(); return $(elem).val();

@ -317,50 +317,30 @@ $(function(){
}); });
$("#promote_level").change(); $("#promote_level").change();
var game_name = "{:I('game_name')}"; var game_server = "{:I('server_name')}";
$("#game_type").change(function(){ $("#game_type").change(function(){
$.ajax({ $.ajax({
url:"{:U('Ajax/getGameList')}", url:"{:U('Ajax/getGmeServer')}",
type:"get", type:"post",
data:{sdk_type:$("#game_type option:selected").val()}, data:{sdk_version:$("#game_type option:selected").val(), game_name:$("#game_name option:selected").val()},
dataType:'json', dataType:'json',
success:function(response){ success:function(data){
str = '<option value="">游戏名称</option>'; str = "<option value=''>请选择区服</option>";
// $.each(response.data, function(index, item){ for (var i in data){
// console.log(item.id); str += "<option value='"+data[i].server_name+"' "+(game_server && data[i].server_name == game_server?'selected':'')+">"+data[i].server_name+"</option>"
// str += '<option value="'+item.id+' '+(promote_id && item.id == promote_id?'selected':'')+'">'+item.nickname+'</option>'; }
// }); $("#server_name").empty();
data = response.data; $("#server_name").append(str);
for (var i in data){ $("#server_name").select2();
str += "<option value='"+data[i].relation_game_name+"' "+(game_name && data[i].relation_game_name == game_name?'selected':'')+">"+data[i].relation_game_name+"</option>" }
} })
$("#game_name").empty(); });
$("#game_name").append(str);
$("#game_name").select2(); $("#game_name").change(function(){
$("#game_name").change(); $("#game_type").change();
} });
}) $("#game_name").change();
});
$("#game_type").change();
var game_server = "{:I('server_id')}";
$("#game_name").change(function(){
$.ajax({
url:"{:U('Ajax/getGmeServer')}",
type:"post",
data:{sdk_version:$("#game_type option:selected").val(), game_name:$("#game_name option:selected").val()},
dataType:'json',
success:function(data){
str = "<option value=''>请选择区服</option>";
for (var i in data){
str += "<option value='"+data[i].server_id+"' "+(game_server && data[i].server_id == game_server?'selected':'')+">"+data[i].server_name+"</option>"
}
$("#server_id").empty();
$("#server_id").append(str);
$("#server_id").select2();
}
})
});
}) })
</script> </script>
</block> </block>

@ -60,19 +60,19 @@
<span class="add-on"><i class="icon-th"></i></span> <span class="add-on"><i class="icon-th"></i></span>
</div> </div>
</div> </div>
<div class="input-list input-list-game search_label_rehab">
<select id="game_type" name="game_type" class="select_gallery" >
<option value="">设备类型</option>
<option value="1">安卓</option>
<option value="2">苹果</option>
</select>
</div>
<div class="input-list input-list-game search_label_rehab"> <div class="input-list input-list-game search_label_rehab">
<select id="game_name" name="game_name" class="select_gallery" > <select id="game_name" name="game_name" class="select_gallery" >
<option value="">游戏名称</option> <option value="">游戏名称</option>
<volist name=":get_game_list(null, $_GET['game_type'])" id="vo">--> <volist name=":getAllGame()" id="vo">
<option game-id="{$vo.id}" value="{$vo.id}">{$vo.game_name}</option> <option value="{$vo.game_name}" <?php echo $vo.relation_game_name == I('game_name') ? 'selected':''; ?> >{$vo.game_name}</option>
</volist> &ndash;&gt; </volist>
</select>
</div>
<div class="input-list input-list-game search_label_rehab">
<select id="game_type" name="game_type" class="select_gallery" >
<option value="">设备类型</option>
<option value="1" <?php echo I('game_type') == 1 ? "selected" : ''?>>安卓</option>
<option value="2" <?php echo I('game_type') == 2 ? "selected" : ''?>>苹果</option>
</select> </select>
</div> </div>
<div class="input-list input-list-server search_label_rehab"> <div class="input-list input-list-server search_label_rehab">
@ -498,46 +498,29 @@
}); });
$("#promote_level").change(); $("#promote_level").change();
var game_name = "{:I('game_name')}";
$("#game_type").change(function(){
$.ajax({
url:"{:U('Ajax/getGameList')}",
type:"get",
data:{sdk_type:$("#game_type option:selected").val()},
dataType:'json',
success:function(response){
str = '<option value="">游戏名称</option>';
data = response.data;
for (var i in data){
str += "<option value='"+data[i].relation_game_name+"' "+(game_name && data[i].relation_game_name == game_name?'selected':'')+">"+data[i].relation_game_name+"</option>"
}
$("#game_name").empty();
$("#game_name").append(str);
$("#game_name").select2();
$("#game_name").change();
}
})
});
$("#game_type").change();
var game_server = "{:I('server_name')}"; var game_server = "{:I('server_name')}";
$("#game_name").change(function(){ $("#game_type").change(function(){
$.ajax({ $.ajax({
url:"{:U('Ajax/getGmeServer')}", url:"{:U('Ajax/getGmeServer')}",
type:"post", type:"post",
data:{sdk_version:$("#game_type option:selected").val(), game_name:$("#game_name option:selected").val()}, data:{sdk_version:$("#game_type option:selected").val(), game_name:$("#game_name option:selected").val()},
dataType:'json', dataType:'json',
success:function(data){ success:function(data){
str = "<option value=''>请选择区服</option>"; str = "<option value=''>请选择区服</option>";
for (var i in data){ for (var i in data){
str += "<option value='"+data[i].server_name+"' "+(game_server && data[i].server_name == game_server?'selected':'')+">"+data[i].server_name+"</option>" str += "<option value='"+data[i].server_name+"' "+(game_server && data[i].server_name == game_server?'selected':'')+">"+data[i].server_name+"</option>"
}
$("#server_name").empty();
$("#server_name").append(str);
$("#server_name").select2();
} }
$("#server_name").empty(); })
$("#server_name").append(str); });
$("#server_name").select2();
} $("#game_name").change(function(){
}) $("#game_type").change();
}); });
$("#game_name").change();
/** /**
* 初始化select2单选默认带搜索功能。 * 初始化select2单选默认带搜索功能。

@ -58,21 +58,21 @@
<div class="input-list"> <div class="input-list">
<input type="text" name="role_name" class="" value="{:I('role_name')}" placeholder="角色名称">&nbsp;&nbsp;&nbsp; <input type="text" name="role_name" class="" value="{:I('role_name')}" placeholder="角色名称">&nbsp;&nbsp;&nbsp;
</div> </div>
<div class="input-list input-list-game search_label_rehab"> <div class="input-list input-list-game search_label_rehab">
<select id="game_type" name="game_type" class="select_gallery" > <select id="game_name" name="game_name" class="select_gallery" >
<option value="">设备类型</option> <option value="">游戏名称</option>
<option value="1">安卓</option> <volist name=":getAllGame()" id="vo">
<option value="2">苹果</option> <option value="{$vo.game_name}" <?php echo $vo.relation_game_name == I('game_name') ? 'selected':''; ?> >{$vo.game_name}</option>
</select> </volist>
</div> </select>
<div class="input-list input-list-game search_label_rehab"> </div>
<select id="game_name" name="game_name" class="select_gallery" > <div class="input-list input-list-game search_label_rehab">
<option value="">游戏名称</option> <select id="game_type" name="game_type" class="select_gallery" >
<!-- <volist name=":get_game_list(null, $_GET['game_type'])" id="vo"> <option value="">设备类型</option>
<option game-id="{$vo.id}" value="{$vo.id}">{$vo.game_name}</option> <option value="1" <?php echo I('game_type') == 1 ? "selected" : ''?>>安卓</option>
</volist> --> <option value="2" <?php echo I('game_type') == 2 ? "selected" : ''?>>苹果</option>
</select> </select>
</div> </div>
<div class="input-list input-list-server search_label_rehab"> <div class="input-list input-list-server search_label_rehab">
<select id="server_id" name="server_id" class="select_gallery" style="width:120px;"> <select id="server_id" name="server_id" class="select_gallery" style="width:120px;">
<option value="">区服名称</option> <option value="">区服名称</option>
@ -279,34 +279,8 @@ $(".select_gallery").select2();
}) })
}); });
$("#promote_level").change(); $("#promote_level").change();
var game_name = "{:I('game_name')}"; var game_server = "{:I('server_name')}";
$("#game_type").change(function(){ $("#game_type").change(function(){
$.ajax({
url:"{:U('Ajax/getGameList')}",
type:"get",
data:{sdk_type:$("#game_type option:selected").val()},
dataType:'json',
success:function(response){
str = '<option value="">游戏名称</option>';
// $.each(response.data, function(index, item){
// console.log(item.id);
// str += '<option value="'+item.id+' '+(promote_id && item.id == promote_id?'selected':'')+'">'+item.nickname+'</option>';
// });
data = response.data;
for (var i in data){
str += "<option value='"+data[i].relation_game_name+"' "+(game_name && data[i].relation_game_name == game_name?'selected':'')+">"+data[i].relation_game_name+"</option>"
}
$("#game_name").empty();
$("#game_name").append(str);
$("#game_name").select2();
$("#game_name").change();
}
})
});
$("#game_type").change();
var game_server = "{:I('server_id')}";
$("#game_name").change(function(){
$.ajax({ $.ajax({
url:"{:U('Ajax/getGmeServer')}", url:"{:U('Ajax/getGmeServer')}",
type:"post", type:"post",
@ -315,13 +289,18 @@ $(".select_gallery").select2();
success:function(data){ success:function(data){
str = "<option value=''>请选择区服</option>"; str = "<option value=''>请选择区服</option>";
for (var i in data){ for (var i in data){
str += "<option value='"+data[i].server_id+"' "+(game_server && data[i].server_id == game_server?'selected':'')+">"+data[i].server_name+"</option>" str += "<option value='"+data[i].server_name+"' "+(game_server && data[i].server_name == game_server?'selected':'')+">"+data[i].server_name+"</option>"
} }
$("#server_id").empty(); $("#server_name").empty();
$("#server_id").append(str); $("#server_name").append(str);
$("#server_id").select2(); $("#server_name").select2();
} }
}) })
}); });
$("#game_name").change(function(){
$("#game_type").change();
});
$("#game_name").change();
</script> </script>
</block> </block>

@ -428,3 +428,15 @@ CREATE TABLE `tab_notice_read` (
ALTER TABLE `tab_user_play_info` ADD INDEX `search`(`promote_id`, `game_id`, `server_id`, `create_time`); ALTER TABLE `tab_user_play_info` ADD INDEX `search`(`promote_id`, `game_id`, `server_id`, `create_time`);
ALTER TABLE `tab_user_login_record` ADD INDEX `search`(`promote_id`, `game_id`, `server_id`, `login_time`); ALTER TABLE `tab_user_login_record` ADD INDEX `search`(`promote_id`, `game_id`, `server_id`, `login_time`);
ALTER TABLE `tab_spend` ADD INDEX `search`(`promote_id`, `game_id`, `server_id`, `pay_way`, `pay_status`, `pay_time`); ALTER TABLE `tab_spend` ADD INDEX `search`(`promote_id`, `game_id`, `server_id`, `pay_way`, `pay_status`, `pay_time`);
-- 添加登录日统计表
CREATE TABLE `tab_login_daily_record` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`game_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '游戏ID',
`user_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '用户ID',
`promote_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '推广员id',
`create_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '创建时间',
PRIMARY KEY (`id`),
KEY `search` (`promote_id`,`game_id`,`create_time`) USING BTREE,
KEY `user_id` (`user_id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=284597 DEFAULT CHARSET=utf8;

Loading…
Cancel
Save