修改bug

master
yulingwei 5 years ago
parent 917b88af21
commit 046beee6be

@ -579,3 +579,9 @@ function arrayPromoteWithdrawStatus($status, $param, $array = 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) {
$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);
}

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

@ -445,6 +445,14 @@ class MemberController extends ThinkController
if (empty($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);
if ($res !== false) {
\Think\Log::actionLog("Member/edit", "Member", $id);

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

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

@ -68,18 +68,18 @@
</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 id="game_name" name="game_name" class="select_gallery" >
<option value="">游戏名称</option>
<volist name=":getAllGame()" id="vo">
<option value="{$vo.game_name}" <?php echo $vo.relation_game_name == I('game_name') ? 'selected':''; ?> >{$vo.game_name}</option>
</volist>
</select>
</div>
<div class="input-list input-list-game search_label_rehab">
<select id="game_name" name="game_name" class="select_gallery" >
<option value="">游戏名称</option>
<!-- <volist name=":get_game_list(null, $_GET['game_type'])" id="vo">
<option game-id="{$vo.id}" value="{$vo.id}">{$vo.game_name}</option>
</volist> -->
<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>
</div>
<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')}";
$("#game_name").change(function(){
$("#game_type").change(function(){
$.ajax({
url:"{:U('Ajax/getGmeServer')}",
type:"post",
@ -298,6 +272,10 @@
})
});
$("#game_name").change(function(){
$("#game_type").change();
});
$("#game_name").change();
})
</script>
</block>

@ -116,18 +116,18 @@
</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">安卓</option>
<option value="2">苹果</option>
<select id="game_name" name="game_name" class="select_gallery" >
<option value="">游戏名称</option>
<volist name=":getAllGame()" id="vo">
<option value="{$vo.game_name}" <?php echo $vo.relation_game_name == I('game_name') ? 'selected':''; ?> >{$vo.game_name}</option>
</volist>
</select>
</div>
<div class="input-list input-list-game search_label_rehab">
<select id="game_name" name="game_name" class="select_gallery" >
<option value="">游戏名称</option>
<!-- <volist name=":get_game_list(null, $_GET['game_type'])" id="vo">
<option game-id="{$vo.id}" value="{$vo.id}">{$vo.game_name}</option>
</volist> -->
<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>
</div>
<div class="input-list input-list-server search_label_rehab">
@ -452,34 +452,8 @@ $(function(){
});
$("#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>';
// $.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(){
$("#game_type").change(function(){
$.ajax({
url:"{:U('Ajax/getGmeServer')}",
type:"post",
@ -497,6 +471,12 @@ $(function(){
})
});
$("#game_name").change(function(){
$("#game_type").change();
});
$("#game_name").change();
function shenhe(status){
var text = $("input:checkbox[name='ids[]']:checked").map(function(index,elem) {
return $(elem).val();

@ -317,34 +317,8 @@ $(function(){
});
$("#promote_level").change();
var game_name = "{:I('game_name')}";
var game_server = "{:I('server_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_id')}";
$("#game_name").change(function(){
$.ajax({
url:"{:U('Ajax/getGmeServer')}",
type:"post",
@ -353,14 +327,20 @@ $(function(){
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>"
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_id").append(str);
$("#server_id").select2();
$("#server_name").empty();
$("#server_name").append(str);
$("#server_name").select2();
}
})
});
$("#game_name").change(function(){
$("#game_type").change();
});
$("#game_name").change();
})
</script>
</block>

@ -61,18 +61,18 @@
</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 id="game_name" name="game_name" class="select_gallery" >
<option value="">游戏名称</option>
<volist name=":getAllGame()" id="vo">
<option value="{$vo.game_name}" <?php echo $vo.relation_game_name == I('game_name') ? 'selected':''; ?> >{$vo.game_name}</option>
</volist>
</select>
</div>
<div class="input-list input-list-game search_label_rehab">
<select id="game_name" name="game_name" class="select_gallery" >
<option value="">游戏名称</option>
<volist name=":get_game_list(null, $_GET['game_type'])" id="vo">-->
<option game-id="{$vo.id}" value="{$vo.id}">{$vo.game_name}</option>
</volist> &ndash;&gt;
<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>
</div>
<div class="input-list input-list-server search_label_rehab">
@ -498,30 +498,8 @@
});
$("#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')}";
$("#game_name").change(function(){
$("#game_type").change(function(){
$.ajax({
url:"{:U('Ajax/getGmeServer')}",
type:"post",
@ -539,6 +517,11 @@
})
});
$("#game_name").change(function(){
$("#game_type").change();
});
$("#game_name").change();
/**
* 初始化select2单选默认带搜索功能。
*/

@ -59,18 +59,18 @@
<input type="text" name="role_name" class="" value="{:I('role_name')}" placeholder="角色名称">&nbsp;&nbsp;&nbsp;
</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 id="game_name" name="game_name" class="select_gallery" >
<option value="">游戏名称</option>
<volist name=":getAllGame()" id="vo">
<option value="{$vo.game_name}" <?php echo $vo.relation_game_name == I('game_name') ? 'selected':''; ?> >{$vo.game_name}</option>
</volist>
</select>
</div>
<div class="input-list input-list-game search_label_rehab">
<select id="game_name" name="game_name" class="select_gallery" >
<option value="">游戏名称</option>
<!-- <volist name=":get_game_list(null, $_GET['game_type'])" id="vo">
<option game-id="{$vo.id}" value="{$vo.id}">{$vo.game_name}</option>
</volist> -->
<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>
</div>
<div class="input-list input-list-server search_label_rehab">
@ -279,34 +279,8 @@ $(".select_gallery").select2();
})
});
$("#promote_level").change();
var game_name = "{:I('game_name')}";
var game_server = "{:I('server_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_id')}";
$("#game_name").change(function(){
$.ajax({
url:"{:U('Ajax/getGmeServer')}",
type:"post",
@ -315,13 +289,18 @@ $(".select_gallery").select2();
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>"
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_id").append(str);
$("#server_id").select2();
$("#server_name").empty();
$("#server_name").append(str);
$("#server_name").select2();
}
})
});
$("#game_name").change(function(){
$("#game_type").change();
});
$("#game_name").change();
</script>
</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_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`);
-- 添加登录日统计表
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