用户登录记录

master
zhengyongxing 5 years ago
parent b61587868b
commit 56d3718c14

@ -788,13 +788,20 @@ class MemberController extends ThinkController
$map['server_name'] = $_REQUEST['server_name']; $map['server_name'] = $_REQUEST['server_name'];
unset($_REQUEST['server_name']); unset($_REQUEST['server_name']);
} }
if (isset($_REQUEST['promote_id'])) {
$map['promote_id'] = $_REQUEST['promote_id'];
unset($_REQUEST['promote_id']);
}
// $map['type'] = 1; // $map['type'] = 1;
// $map['login_time'] = ['exp', 'login_time<>0']; // $map['login_time'] = ['exp', 'login_time<>0'];
$extend = array(); $extend = array();
$extend['map'] = $map; $extend['map'] = $map;
$count = M('UserLoginRecord','tab_')->field('user_id')->where($extend['map'])->group('user_id')->select(false);
$sql = "select count(user_id) as count from ({$count})t";
$count = M('UserLoginRecord','tab_')->query($sql);
$this->m_title = '登录记录'; $this->m_title = '登录记录';
$this->assign('user_count',$count[0]['count']);
$this->assign('commonset', M('Kuaijieicon')->where(['url' => 'Member/login_record', 'status' => 1])->find()); $this->assign('commonset', M('Kuaijieicon')->where(['url' => 'Member/login_record', 'status' => 1])->find());
parent::lists("UserLoginRecord", $p, $extend['map']); parent::lists("UserLoginRecord", $p, $extend['map']);

@ -90,6 +90,21 @@
<div class="input-list"> <div class="input-list">
<input type="text" name="login_ip" class="" placeholder="登录IP" value="{:I('login_ip')}"> <input type="text" name="login_ip" class="" placeholder="登录IP" value="{:I('login_ip')}">
</div> </div>
<div class="input-list search_item input-list-gamenoticestatus">
<select name="promote_level" style="color:#444" class="select_gallery" id="promote_level">
<option value="">请选择推广员等级</option>
<option value="1" <?php if ($_POST['promote_level'] == 1):?>selected<?php endif;?>>会长</option>
<option value="2" <?php if ($_POST['promote_level'] == 2):?>selected<?php endif;?>>部门长</option>
<option value="3" <?php if ($_POST['promote_level'] == 3):?>selected<?php endif;?>>组长</option>
<option value="4" <?php if ($_POST['promote_level'] == 4):?>selected<?php endif;?>>组员</option>
</select>
-
</div>
<div class="input-list search_item input-list-gamenoticestatus">
<select name="promote_id" style="color:#444" class="select_gallery" id="promote_id">
<option value="">请选择推广员</option>
</select>
</div>
<div class="input-list"> <div class="input-list">
<a class="sch-btn" href="javascript:;" id="search" <a class="sch-btn" href="javascript:;" id="search"
url="{:U('Member/login_record','model='.$model['name'] . '&row=' . I('row'),false)}"> url="{:U('Member/login_record','model='.$model['name'] . '&row=' . I('row'),false)}">
@ -139,6 +154,10 @@
</td> </td>
</tr> </tr>
</volist> </volist>
<tr>
<td colspan="2">合计</td>
<td colspan="4">&#12288;&#12288;登录玩家:{$user_count}人 </td>
</tr>
</empty> </empty>
</tbody> </tbody>
</table> </table>
@ -178,6 +197,7 @@
highlight_subnav("{:U('Member/login_record')}"); highlight_subnav("{:U('Member/login_record')}");
$(function () { $(function () {
<volist name = ":I('get.')" id = "vo" > Think.setValue('{$key}', "{$vo}"); <volist name = ":I('get.')" id = "vo" > Think.setValue('{$key}', "{$vo}");
</volist > </volist >
$(".select_gallery").select2(); $(".select_gallery").select2();
@ -276,6 +296,28 @@
$("#game_type").change(); $("#game_type").change();
}); });
$("#game_name").change(); $("#game_name").change();
var promote_id = "{:I('promote_id')}";
$("#promote_level").change(function(){
$.ajax({
url:"{:U('Ajax/getPromotersByLevel')}",
type:"get",
data:{level:$("#promote_level option:selected").val()},
dataType:'json',
success:function(response){
str = '<option value="">请选择推广员</option><option value="0"'+(promote_id && 0 == promote_id?'selected':'')+'>官方渠道</option>';
data = response.data;
for (var i in data){
str += "<option value='"+data[i].id+"' "+(promote_id && data[i].id == promote_id?'selected':'')+">"+data[i].nickname+"</option>"
}
$("#promote_id").empty();
$("#promote_id").append(str);
$("#promote_id").select2();
}
})
});
$("#promote_level").change();
}) })
</script> </script>
</block> </block>

Loading…
Cancel
Save