diff --git a/Application/Admin/Controller/AutoPackController.class.php b/Application/Admin/Controller/AutoPackController.class.php index 48f286288..e4a6b4bb1 100644 --- a/Application/Admin/Controller/AutoPackController.class.php +++ b/Application/Admin/Controller/AutoPackController.class.php @@ -297,17 +297,17 @@ class AutoPackController extends Think $map = []; $map['status'] = 1; $map['enable_status'] = ['in', '0,2']; - + $applys = M('apply', 'tab_')->field('id,game_id,game_name,promote_id,promote_account,sdk_version') ->where($map) ->order('bale_sort desc,id desc') ->limit(200) ->select(); - + if (count($applys) == 0) { Printer::export('无等待队列', true); } - + $applyIds = array_column($applys, 'id'); M('apply', 'tab_')->where(['id' => ['in', $applyIds]])->save(['enable_status' => 3]); @@ -353,7 +353,7 @@ class AutoPackController extends Think ->field('a.id,a.game_id,a.game_name,a.promote_account,a.pack_url,a.plist_url,a.promote_id,a.sdk_version,a.enable_status') ->join('tab_apply_launch as al on (al.apply_id=a.id) ') ->where($map) - ->limit(300) + ->limit(300) ->group('a.id') ->select(); foreach ($apply as $key => $value) { @@ -367,7 +367,7 @@ class AutoPackController extends Think $launchmodel -> where(['apply_id' => $value['id']]) -> setField('launch_packge', 0); continue; } - + if (!empty($gameSourceUrl) && is_file($gameSourceUrl)) { $launch = $launchmodel -> where(['apply_id' => $value['id'], 'launch_packge' => array('in', [0, 2, 3])]) -> select(); @@ -1054,6 +1054,4 @@ class AutoPackController extends Think return ''; } } - - } diff --git a/Application/Admin/Controller/UserController.class.php b/Application/Admin/Controller/UserController.class.php index 14fac80d8..8c95a0240 100644 --- a/Application/Admin/Controller/UserController.class.php +++ b/Application/Admin/Controller/UserController.class.php @@ -8,6 +8,7 @@ // +---------------------------------------------------------------------- namespace Admin\Controller; + use User\Api\UserApi; use Com\Wechat; use Com\WechatAuth; @@ -16,32 +17,34 @@ use Com\WechatAuth; * 后台用户控制器 * @author 麦当苗儿 */ -class UserController extends AdminController { +class UserController extends AdminController +{ /** * 用户管理首页 * @author 麦当苗儿 */ - public function index(){ - $nickname = I('nickname'); - if(isset($_REQUEST['status'])){ - $map['status'] = $_REQUEST['status']; - } - if(is_numeric($nickname)){ - $map['uid|nickname']= array(intval($nickname),array('like','%'.$nickname.'%'),'_multi'=>true); - }else{ - $map['nickname'] = array('like', '%'.(string)$nickname.'%'); - } - - $list = $this->lists('Member', $map); + public function index() + { + $nickname = I('nickname'); + if (isset($_REQUEST['status'])) { + $map['status'] = $_REQUEST['status']; + } + if (is_numeric($nickname)) { + $map['uid|nickname'] = array(intval($nickname), array('like', '%' . $nickname . '%'), '_multi' => true); + } else { + $map['nickname'] = array('like', '%' . (string)$nickname . '%'); + } + + $list = $this->lists('Member', $map); int_to_string($list); $this->assign('_list', $list); $this->meta_title = '管理员列表'; - - $this->m_title = '管理员列表'; - $this->assign('commonset',M('Kuaijieicon')->where(['url'=>'User/index','status'=>1])->find()); - + + $this->m_title = '管理员列表'; + $this->assign('commonset', M('Kuaijieicon')->where(['url' => 'User/index', 'status' => 1])->find()); + $this->display(); } @@ -49,7 +52,8 @@ class UserController extends AdminController { * 修改昵称初始化 * @author huajie */ - public function updateNickname(){ + public function updateNickname() + { $nickname = M('Member')->getFieldByUid(UID, 'nickname'); $this->assign('nickname', $nickname); $this->meta_title = '修改昵称'; @@ -60,7 +64,8 @@ class UserController extends AdminController { * 修改昵称提交 * @author huajie */ - public function submitNickname(){ + public function submitNickname() + { //获取参数 $nickname = I('post.nickname'); $password = I('post.password'); @@ -68,25 +73,25 @@ class UserController extends AdminController { empty($password) && $this->error('请输入密码'); //密码验证 - $User = new UserApi(); - $uid = $User->login(UID, $password, 4); + $User = new UserApi(); + $uid = $User->login(UID, $password, 4); ($uid == -2) && $this->error('密码不正确'); - $Member = D('Member'); - $data = $Member->create(array('nickname'=>$nickname)); - if(!$data){ + $Member = D('Member'); + $data = $Member->create(array('nickname' => $nickname)); + if (!$data) { $this->error($Member->getError()); } - $res = $Member->where(array('uid'=>$uid))->save($data); + $res = $Member->where(array('uid' => $uid))->save($data); - if($res){ - $user = session('user_auth'); - $user['username'] = $data['nickname']; + if ($res) { + $user = session('user_auth'); + $user['username'] = $data['nickname']; session('user_auth', $user); session('user_auth_sign', data_auth_sign($user)); $this->success('修改昵称成功!'); - }else{ + } else { $this->error('修改昵称失败!'); } } @@ -95,7 +100,8 @@ class UserController extends AdminController { * 修改密码初始化 * @author huajie */ - public function updatePassword(){ + public function updatePassword() + { $this->meta_title = '修改密码'; $this->display('updatepassword'); } @@ -104,24 +110,25 @@ class UserController extends AdminController { * 修改密码提交 * @author huajie */ - public function submitPassword(){ + public function submitPassword() + { //获取参数 - $password = I('post.old'); + $password = I('post.old'); empty($password) && $this->error('请输入原密码'); $data['password'] = I('post.password'); empty($data['password']) && $this->error('请输入新密码'); $repassword = I('post.repassword'); empty($repassword) && $this->error('请输入确认密码'); - if($data['password'] !== $repassword){ + if ($data['password'] !== $repassword) { $this->error('您输入的新密码与确认密码不一致'); } - $Api = new UserApi(); - $res = $Api->updateInfo(UID, $password, $data); - if($res['status']){ + $Api = new UserApi(); + $res = $Api->updateInfo(UID, $password, $data); + if ($res['status']) { $this->success('修改密码成功!'); - }else{ + } else { $this->error($res['info']); } } @@ -130,13 +137,14 @@ class UserController extends AdminController { * 用户行为列表 * @author huajie */ - public function action(){ + public function action() + { //获取列表数据 - $Action = M('Action')->where(array('status'=>array('gt',-1))); - $list = $this->lists($Action); + $Action = M('Action')->where(array('status' => array('gt', -1))); + $list = $this->lists($Action); int_to_string($list); // 记录当前列表页的cookie - Cookie('__forward__',$_SERVER['REQUEST_URI']); + Cookie('__forward__', $_SERVER['REQUEST_URI']); $this->assign('_list', $list); $this->meta_title = '用户行为'; @@ -147,9 +155,10 @@ class UserController extends AdminController { * 新增行为 * @author huajie */ - public function addAction(){ + public function addAction() + { $this->meta_title = '新增行为'; - $this->assign('data',null); + $this->assign('data', null); $this->display('editaction'); } @@ -157,12 +166,13 @@ class UserController extends AdminController { * 编辑行为 * @author huajie */ - public function editAction(){ + public function editAction() + { $id = I('get.id'); empty($id) && $this->error('参数不能为空!'); $data = M('Action')->field(true)->find($id); - $this->assign('data',$data); + $this->assign('data', $data); $this->meta_title = '编辑行为'; $this->display('editaction'); } @@ -171,12 +181,13 @@ class UserController extends AdminController { * 更新行为 * @author huajie */ - public function saveAction(){ + public function saveAction() + { $res = D('Action')->update(); - if(!$res){ + if (!$res) { $this->error(D('Action')->getError()); - }else{ - $this->success($res['id']?'更新成功!':'新增成功!', Cookie('__forward__')); + } else { + $this->success($res['id'] ? '更新成功!' : '新增成功!', Cookie('__forward__')); } } @@ -184,23 +195,24 @@ class UserController extends AdminController { * 会员状态修改 * @author 朱亚杰 */ - public function changeUserStatus($method=null){ - $id = array_unique((array)I('id',0)); - if( in_array(C('USER_ADMINISTRATOR'), $id)){ + public function changeUserStatus($method = null) + { + $id = array_unique((array)I('id', 0)); + if (in_array(C('USER_ADMINISTRATOR'), $id)) { $this->error("不允许对超级管理员执行该操作!"); } - $id = is_array($id) ? implode(',',$id) : $id; - if ( empty($id) ) { + $id = is_array($id) ? implode(',', $id) : $id; + if (empty($id)) { $this->error('请选择要操作的数据!'); } - $map['uid'] = array('in',$id); - $map1['id'] = array('in',$id); - $status=I('method')=='forbidUser'?0:1; - $res= M('UcenterMember')->where($map1)->setField('status',$status); - $res1= M('Member')->where($map)->setField('status',$status); - if($res&&$res1){ + $map['uid'] = array('in', $id); + $map1['id'] = array('in', $id); + $status = I('method') == 'forbidUser' ? 0 : 1; + $res = M('UcenterMember')->where($map1)->setField('status', $status); + $res1 = M('Member')->where($map)->setField('status', $status); + if ($res && $res1) { $this->success('更新成功!'); - }else{ + } else { $this->error('更新失败!'); } @@ -211,43 +223,45 @@ class UserController extends AdminController { * 会员状态修改 * @author 朱亚杰 */ - public function changeStatus($method=null){ - $id = array_unique((array)I('id',0)); - if( in_array(C('USER_ADMINISTRATOR'), $id)){ + public function changeStatus($method = null) + { + $id = array_unique((array)I('id', 0)); + if (in_array(C('USER_ADMINISTRATOR'), $id)) { $this->error("不允许对超级管理员执行该操作!"); } - $id = is_array($id) ? implode(',',$id) : $id; - if ( empty($id) ) { + $id = is_array($id) ? implode(',', $id) : $id; + if (empty($id)) { $this->error('请选择要操作的数据!'); } - $map['uid'] = array('in',$id); - switch ( strtolower($method) ){ + $map['uid'] = array('in', $id); + switch (strtolower($method)) { case 'forbiduser': - \Think\Log::actionLog('User/changeStatus?method=forbidUser','user',1); - $this->forbid('Member', $map ); + \Think\Log::actionLog('User/changeStatus?method=forbidUser', 'user', 1); + $this->forbid('Member', $map); break; case 'resumeuser': - \Think\Log::actionLog('User/changeStatus?method=resumeuser','user',1); - $this->resume('Member', $map ); + \Think\Log::actionLog('User/changeStatus?method=resumeuser', 'user', 1); + $this->resume('Member', $map); break; case 'deleteuser': - \Think\Log::actionLog('User/changeStatus?method=deleteuser','user',1); - $this->delete('Member', $map ); + \Think\Log::actionLog('User/changeStatus?method=deleteuser', 'user', 1); + $this->delete('Member', $map); break; default: $this->error('参数非法'); } } - public function add($username = '', $password = '', $repassword = '', $email = '',$second_pwd=''){ + public function add($username = '', $password = '', $repassword = '', $email = '', $second_pwd = '') + { - if(IS_POST){ + if (IS_POST) { /*检测用户名是否为空*/ - if (empty($username)){ + if (empty($username)) { $this->error('管理员账号不能为空!'); } /* 检测密码 */ - if($password != $repassword){ + if ($password != $repassword) { $this->error('管理员密码和确认密码不一致!'); } $usernameUser = M('UcenterMember', 'sys_')->field('username')->where(['username' => $username])->find(); @@ -259,84 +273,87 @@ class UserController extends AdminController { $this->error('邮箱已存在!'); } /* 调用注册接口注册用户 */ - $User = new UserApi; - $uid = $User->register($username, $password, $email,$second_pwd); - if(0 < $uid){ //注册成功 + $User = new UserApi; + $uid = $User->register($username, $password, $email, $second_pwd); + if (0 < $uid) { //注册成功 $user = array('uid' => $uid, 'nickname' => $username, 'status' => 1); $data['uid'] = $uid; $data['group_id'] = I('auth'); M('auth_group_access')->data($data)->add(); - if(!M('Member')->add($user)){ + if (!M('Member')->add($user)) { $this->error('用户添加失败!'); } else { - \Think\Log::actionLog('User/add','Member',$uid); - $this->success('用户添加成功!',U('index')); + \Think\Log::actionLog('User/add', 'Member', $uid); + $this->success('用户添加成功!', U('index')); } } else { //注册失败,显示错误信息 $this->error($this->showRegError($uid)); } } else { - $list=D('AuthGroup')->where(array('status'=>1))->select(); - $this->assign('lists',$list); + $list = D('AuthGroup')->where(array('status' => 1))->select(); + $this->assign('lists', $list); $this->meta_title = '新增管理员'; - - - $this->m_title = '管理员列表'; - $this->assign('commonset',M('Kuaijieicon')->where(['url'=>'User/index','status'=>1])->find()); - - + + $this->m_title = '管理员列表'; + $this->assign('commonset', M('Kuaijieicon')->where(['url' => 'User/index', 'status' => 1])->find()); + + $this->display(); } } -/** - * 系统非常规MD5加密方法 - * @param string $str 要加密的字符串 - * @return string - */ -function think_ucenter_md5($str, $key = 'ThinkUCenter'){ - return '' === $str ? '' : md5(sha1($str) . $key); -} - public function edit($id){ + + /** + * 系统非常规MD5加密方法 + * @param string $str 要加密的字符串 + * @return string + */ + function think_ucenter_md5($str, $key = 'ThinkUCenter') + { + return '' === $str ? '' : md5(sha1($str) . $key); + } + + public function edit($id) + { // var_dump(session());exit; - if(IS_POST){ - if(isset($_POST['bind_wx'])){ - if($_POST['bind_wx']=='unbind_wx'){ - $info['admin_openid']=''; - }else{ - $info['admin_openid']=session('admin_openid'); - if($info['admin_openid']==''){ + if (IS_POST) { + if (isset($_POST['bind_wx'])) { + if ($_POST['bind_wx'] == 'unbind_wx') { + $info['admin_openid'] = ''; + } else { + $info['admin_openid'] = session('admin_openid'); + if ($info['admin_openid'] == '') { $this->error('请在30分钟内扫描并关注微信公众号!'); } } } - if($_POST['auth']==''&&$id!=1){ + if ($_POST['auth'] == '' && $id != 1) { $this->error('请选择用户权限!'); } - if($_POST['password']==''){ + if ($_POST['password'] == '') { //$this->error('请填写管理员密码!'); } - if(!empty($_POST['password']) && (strlen($_POST['password'])<6 || strlen($_POST['password']) > 30)){ + if (!empty($_POST['password']) && (strlen($_POST['password']) < 6 || strlen($_POST['password']) > 30)) { $this->error('管理员密码长度必须在6-30个字符之间!'); } - if($_POST['second_pwd']==''){ + if ($_POST['second_pwd'] == '') { //$this->error('请填写二级密码!'); } - if(!empty($_POST['second_pwd']) && (strlen($_POST['second_pwd'])<6 || strlen($_POST['second_pwd']) > 30)){ + if (!empty($_POST['second_pwd']) && (strlen($_POST['second_pwd']) < 6 || strlen($_POST['second_pwd']) > 30)) { $this->error('二级密码长度必须在6-30个字符之间!'); } - if($_POST['email']==''){ + if ($_POST['email'] == '') { $this->error('请填写邮箱!'); } - - $pattern = "/([a-z0-9]*[-_.]?[a-z0-9]+)*@([a-z0-9]*[-_]?[a-z0-9]+)+[.][a-z]{2,3}([.][a-z]{2})?/i"; - - if(!preg_match( $pattern, $_POST['email'])) { - $this->error('邮箱格式不正确!'); - } - if(isset($_POST['mobile'])&&$_POST['mobile']!=''){ + + $pattern = "/([a-z0-9]*[-_.]?[a-z0-9]+)*@([a-z0-9]*[-_]?[a-z0-9]+)+[.][a-z]{2,3}([.][a-z]{2})?/i"; + + if (!preg_match($pattern, $_POST['email'])) { + $this->error('邮箱格式不正确!'); + } + if (isset($_POST['mobile']) && $_POST['mobile'] != '') { $dx = A('Phone'); - $res = $dx->check_tel_code($_POST['mobile'],$_POST['code']); + $res = $dx->check_tel_code($_POST['mobile'], $_POST['code']); switch ($res) { case '-1': $this->error('短信验证码无效,请重新获取'); @@ -349,27 +366,27 @@ function think_ucenter_md5($str, $key = 'ThinkUCenter'){ break; } } - $Member=D('UcenterMember'); - $mem=D('Member'); - $au=D('AuthGroupAccess'); - $map['id']=$id; - $maps['uid']=$id; - $info['username']=$_POST['username']; - $in['nickname']=$_POST['username']; - $pwd=$this->think_ucenter_md5($_POST['password'],UC_AUTH_KEY); - $spwd=$this->think_ucenter_md5($_POST['second_pwd'],UC_AUTH_KEY); - $rpwd=$Member->where(array('id'=>$id))->find(); - $oldpwd=$rpwd['password']; - $oldspwd=$rpwd['second_pwd']; + $Member = D('UcenterMember'); + $mem = D('Member'); + $au = D('AuthGroupAccess'); + $map['id'] = $id; + $maps['uid'] = $id; + $info['username'] = $_POST['username']; + $in['nickname'] = $_POST['username']; + $pwd = $this->think_ucenter_md5($_POST['password'], UC_AUTH_KEY); + $spwd = $this->think_ucenter_md5($_POST['second_pwd'], UC_AUTH_KEY); + $rpwd = $Member->where(array('id' => $id))->find(); + $oldpwd = $rpwd['password']; + $oldspwd = $rpwd['second_pwd']; $User = new UserApi; - $info['password']= (empty($pwd) || $pwd==$oldpwd)?$oldpwd:$pwd; - $info['second_pwd']= (empty($spwd) || $spwd==$oldspwd)?$oldspwd:$spwd; - $info['email']=$_POST['email']; - $info['mobile']=isset($_POST['mobile'])?$_POST['mobile']:''; - $ss['group_id']=$_POST['auth']; - $ss['houtai']=$_POST['houtai']; - $smember=$Member->where($map)->save($info); - $meb=$mem->where($maps)->save($in); + $info['password'] = (empty($pwd) || $pwd == $oldpwd) ? $oldpwd : $pwd; + $info['second_pwd'] = (empty($spwd) || $spwd == $oldspwd) ? $oldspwd : $spwd; + $info['email'] = $_POST['email']; + $info['mobile'] = isset($_POST['mobile']) ? $_POST['mobile'] : ''; + $ss['group_id'] = $_POST['auth']; + $ss['houtai'] = $_POST['houtai']; + $smember = $Member->where($map)->save($info); + $meb = $mem->where($maps)->save($in); if ($au->where(array('uid' => $id))->find()) { if ($ss['group_id'] == '') { unset($ss['group_id']); @@ -379,178 +396,223 @@ function think_ucenter_md5($str, $key = 'ThinkUCenter'){ $ss['uid'] = $id; $ag = $au->add($ss); } - - if($smember !== false||$meb||$ag){ - M('user_pwd')->where($maps)->setField('password',think_encrypt($info['password'])); - $this->success('修改成功!',U('User/index')); - }else{ - $this->error('修改失败!',U('User/index')); + + if ($smember !== false || $meb || $ag) { + M('user_pwd')->where($maps)->setField('password', think_encrypt($info['password'])); + $this->success('修改成功!', U('User/index')); + } else { + $this->error('修改失败!', U('User/index')); } - }else{ - $map['id']=$_GET['id']; - $Member=D('UcenterMember')->where($map)->find(); - $au=D('AuthGroupAccess')->where(array('uid'=>$_GET['id']))->find(); - $this->assign("authid",$au["group_id"]); - $this->assign("houtai",$au["houtai"]); - $list=D('AuthGroup')->where(array('status'=>1))->select(); - $username=$_POST['username']; - $password=$_POST['password']; - $this->assign('lists',$list); - $this->assign('list',$Member); - $this->assign('sd',$group); - $this->meta_title = '编辑管理员'; - - $this->m_title = '管理员列表'; - $this->assign('commonset',M('Kuaijieicon')->where(['url'=>'User/index','status'=>1])->find()); - - + } else { + $map['id'] = $_GET['id']; + $Member = D('UcenterMember')->where($map)->find(); + $au = D('AuthGroupAccess')->where(array('uid' => $_GET['id']))->find(); + $this->assign("authid", $au["group_id"]); + $this->assign("houtai", $au["houtai"]); + $list = D('AuthGroup')->where(array('status' => 1))->select(); + $username = $_POST['username']; + $password = $_POST['password']; + $this->assign('lists', $list); + $this->assign('list', $Member); + $this->assign('sd', $group); + $this->meta_title = '编辑管理员'; + + $this->m_title = '管理员列表'; + $this->assign('commonset', M('Kuaijieicon')->where(['url' => 'User/index', 'status' => 1])->find()); + + $this->display(); } } - public function bdwx(){ - $map['id']=UID; - $Member=D('UcenterMember')->field('id,username,admin_openid,openid_sign')->where($map)->find(); - $this->assign('id',$map['id']); - $this->assign('list',$Member); + + public function bdwx() + { + $map['id'] = UID; + $Member = D('UcenterMember')->field('id,username,admin_openid,openid_sign')->where($map)->find(); + $this->assign('id', $map['id']); + $this->assign('list', $Member); $this->meta_title = '绑定微信'; $this->display(); } - public function updatelist($p=0){ + + public function updatelist($p = 0) + { $page = intval($p); $page = $page ? $page : 1; //默认显示第一页数据 - if(isset($_REQUEST['row'])) {$row = $_REQUEST['row'];}else{$row = 10;} - if(isset($_REQUEST['op_account'])){ - if ($_REQUEST['op_account']=='全部') { + if (isset($_REQUEST['row'])) { + $row = $_REQUEST['row']; + } else { + $row = 10; + } + if (isset($_REQUEST['op_account'])) { + if ($_REQUEST['op_account'] == '全部') { unset($_REQUEST['op_account']); - }else{ - $map['op_account'] = trim($_REQUEST['op_account']); + } else { + $map['op_account'] = trim($_REQUEST['op_account']); unset($_REQUEST['op_account']); } } - if(isset($_REQUEST['game_name'])){ - $map['game_name'] = trim($_REQUEST['game_name']); + if (isset($_REQUEST['game_name'])) { + $map['game_name'] = trim($_REQUEST['game_name']); unset($_REQUEST['game_name']); } - if(isset($_REQUEST['account'])){ - $map['user_account'] = array('like','%'.trim($_REQUEST['account']).'%'); + if (isset($_REQUEST['account'])) { + $map['user_account'] = array('like', '%' . trim($_REQUEST['account']) . '%'); unset($_REQUEST['account']); } - if(isset($_REQUEST['huobi'])){ - $map['type'] = $_REQUEST['huobi']; + if (isset($_REQUEST['huobi'])) { + $map['type'] = $_REQUEST['huobi']; unset($_REQUEST['huobi']); } - if(isset($_REQUEST['timestart']) && isset($_REQUEST['timeend'])){ - $map['create_time'] = array('BETWEEN',array(strtotime($_REQUEST['timestart']),strtotime($_REQUEST['timeend'])+24*60*60-1)); - unset($_REQUEST['timestart']);unset($_REQUEST['timeend']); - }elseif(isset($_REQUEST['timestart'])){ - $map['create_time'] = ['GT',strtotime(I('timestart'))]; + if (isset($_REQUEST['timestart']) && isset($_REQUEST['timeend'])) { + $map['create_time'] = array('BETWEEN', array(strtotime($_REQUEST['timestart']), strtotime($_REQUEST['timeend']) + 24 * 60 * 60 - 1)); unset($_REQUEST['timestart']); - }elseif(isset($_REQUEST['timeend'])){ - $map['create_time'] = ['LT',strtotime(I('timeend'))+86399]; + unset($_REQUEST['timeend']); + } elseif (isset($_REQUEST['timestart'])) { + $map['create_time'] = ['GT', strtotime(I('timestart'))]; + unset($_REQUEST['timestart']); + } elseif (isset($_REQUEST['timeend'])) { + $map['create_time'] = ['LT', strtotime(I('timeend')) + 86399]; unset($_REQUEST['timeend']); } - $list=M('balance_edit','tab_') + $list = M('balance_edit', 'tab_') ->where($map) ->order('create_time desc') ->page($page, $row) ->select(); - $count = M('balance_edit','tab_')->where($map)->count(); + $count = M('balance_edit', 'tab_')->where($map)->count(); //分页 - $page = set_pagination($count,$row); - if($page) {$this->assign('_page', $page);} - - $this->assign('list',$list); + $page = set_pagination($count, $row); + if ($page) { + $this->assign('_page', $page); + } + + $this->assign('list', $list); $this->meta_title = '修改记录'; - - $this->m_title = '账户修改记录'; - $this->assign('commonset',M('Kuaijieicon')->where(['url'=>'Member/login_record','status'=>1])->find()); - - + + $this->m_title = '账户修改记录'; + $this->assign('commonset', M('Kuaijieicon')->where(['url' => 'Member/login_record', 'status' => 1])->find()); + + $this->display('updatelist'); } + /** * 获取用户注册错误信息 - * @param integer $code 错误编码 + * @param integer $code 错误编码 * @return string 错误信息 */ - private function showRegError($code = 0){ + private function showRegError($code = 0) + { switch ($code) { - case -1: $error = '管理员账号长度必须在16个字符以内!'; break; - case -2: $error = '管理员账号被禁止注册!'; break; - case -3: $error = '管理员账号被占用!'; break; - case -4: $error = '管理员密码长度必须在6-30个字符之间!'; break; - case -5: $error = '邮箱格式不正确!'; break; - case -6: $error = '邮箱长度必须在1-32个字符之间!'; break; - case -7: $error = '邮箱被禁止注册!'; break; - case -8: $error = '邮箱被占用!'; break; - case -9: $error = '手机格式不正确!'; break; - case -10: $error = '手机被禁止注册!'; break; - case -11: $error = '手机号被占用!'; break; - case -12: $error = '二级密码长度必须在6-30个字符之间!';break; - default: $error = '未知错误'; + case -1: + $error = '管理员账号长度必须在16个字符以内!'; + break; + case -2: + $error = '管理员账号被禁止注册!'; + break; + case -3: + $error = '管理员账号被占用!'; + break; + case -4: + $error = '管理员密码长度必须在6-30个字符之间!'; + break; + case -5: + $error = '邮箱格式不正确!'; + break; + case -6: + $error = '邮箱长度必须在1-32个字符之间!'; + break; + case -7: + $error = '邮箱被禁止注册!'; + break; + case -8: + $error = '邮箱被占用!'; + break; + case -9: + $error = '手机格式不正确!'; + break; + case -10: + $error = '手机被禁止注册!'; + break; + case -11: + $error = '手机号被占用!'; + break; + case -12: + $error = '二级密码长度必须在6-30个字符之间!'; + break; + default: + $error = '未知错误'; } return $error; } - public function get_openid(){ + + public function get_openid() + { $User = new UserApi; - if($_POST['id']>999){ - $this->ajaxReturn(array('status'=>0,'msg'=>'管理员id不能大于999')); + if ($_POST['id'] > 999) { + $this->ajaxReturn(array('status' => 0, 'msg' => '管理员id不能大于999')); } $data = $User->verifyPwd($_POST['id'], $_POST['pwd']); - if(!$data){ - $this->ajaxReturn(array('status'=>0,'msg'=>'密码错误,请重新选择')); + if (!$data) { + $this->ajaxReturn(array('status' => 0, 'msg' => '密码错误,请重新选择')); } - $appid = C('wechat.appid'); + $appid = C('wechat.appid'); $appsecret = C('wechat.appsecret'); - $result=auto_get_access_token(dirname(__FILE__).'/access_token_validity.txt'); - if($result['is_validity']){ - session('token',$result['access_token']); - $auth = new WechatAuth($appid, $appsecret,$result['access_token']); - }else{ - $auth = new WechatAuth($appid, $appsecret); + $result = auto_get_access_token(dirname(__FILE__) . '/access_token_validity.txt'); + if ($result['is_validity']) { + session('token', $result['access_token']); + $auth = new WechatAuth($appid, $appsecret, $result['access_token']); + } else { + $auth = new WechatAuth($appid, $appsecret); $token = $auth->getAccessToken(); - $token['expires_in_validity']=time()+$token['expires_in']; - wite_text(json_encode($token),dirname(__FILE__).'/access_token_validity.txt'); - session('token',$token['access_token']); + $token['expires_in_validity'] = time() + $token['expires_in']; + wite_text(json_encode($token), dirname(__FILE__) . '/access_token_validity.txt'); + session('token', $token['access_token']); } - $times=date('s',time()); + $times = date('s', time()); // $scene_id=strrev($_POST['id'].$times); - $scene_id=$_POST['id'].$times.$_POST['type']; - session('scene_id',$scene_id); - $ticket = $auth->qrcodeCreate($scene_id,600);//10分钟 - if($ticket==''){ - $return=array('status'=>0,'data'=>'获取ticket失败!'); + $scene_id = $_POST['id'] . $times . $_POST['type']; + session('scene_id', $scene_id); + $ticket = $auth->qrcodeCreate($scene_id, 600);//10分钟 + if ($ticket == '') { + $return = array('status' => 0, 'data' => '获取ticket失败!'); } $qrcode = $auth->showqrcode($ticket['ticket']); - $return=array('status'=>1,'data'=>$qrcode); + $return = array('status' => 1, 'data' => $qrcode); $this->ajaxReturn($return); } - function checkpwd(){ + + function checkpwd() + { $User = new UserApi; $data = $User->verifyPwd($_POST['id'], $_POST['pwd']); - $this->ajaxReturn(array('data'=>$data)); + $this->ajaxReturn(array('data' => $data)); } - function checkOpenidpic(){ + + function checkOpenidpic() + { sleep(2); - $data=M('ucenter_member')->where(array('id'=>$_REQUEST['id']))->find(); - if($data['openid_sign']==session('scene_id')){ - $this->ajaxReturn(array("status"=>1)); - }else{ - $this->ajaxReturn(array("status"=>0)); + $data = M('ucenter_member')->where(array('id' => $_REQUEST['id']))->find(); + if ($data['openid_sign'] == session('scene_id')) { + $this->ajaxReturn(array("status" => 1)); + } else { + $this->ajaxReturn(array("status" => 0)); } } - public function delete($id){ + public function delete($id) + { M()->startTrans(); $res1 = M('member')->delete($id); $res2 = M('ucenter_member')->delete($id); - $res3 = M('auth_group_access')->where(array('uid'=>$id))->delete(); - if($res1 && $res2 && $res3){ + $res3 = M('auth_group_access')->where(array('uid' => $id))->delete(); + if ($res1 && $res2 && $res3) { M()->commit(); $this->success('删除成功'); - }else{ + } else { M()->rollback(); - $this->error('删除失败'.M()->getError()); + $this->error('删除失败' . M()->getError()); } } @@ -558,7 +620,7 @@ function think_ucenter_md5($str, $key = 'ThinkUCenter'){ { $map = []; if (isset($_REQUEST['game_name'])) { - $map['game_name'] = ['like', trim($_REQUEST['game_name'])."%"]; + $map['game_name'] = ['like', trim($_REQUEST['game_name']) . "%"]; unset($_REQUEST['game_name']); } if (isset($_REQUEST['server_id'])) { @@ -578,19 +640,19 @@ function think_ucenter_md5($str, $key = 'ThinkUCenter'){ $promoter_ids = D("Promote")->where($queryStr)->field('id')->select(); $promoter_ids ? $map['promote_id'] = ['in', implode(',', array_column($promoter_ids, 'id'))] : null; } - + } if (isset($_REQUEST['game_type'])) { $map['sdk_version'] = trim($_REQUEST['game_type']); unset($_REQUEST['game_type']); } - empty(I('user_account')) || $map['user_account'] = ['like',"%".I('user_account')."%"]; + empty(I('user_account')) || $map['user_account'] = ['like', "%" . I('user_account') . "%"]; $list = $this->lists(M('user_play_info', 'tab_'), $map, 'play_time desc'); $this->assign('list', $list); $this->meta_title = '角色数据'; - - $this->m_title = '角色查询'; - $this->assign('commonset',M('Kuaijieicon')->where(['url'=>'User/rolelist','status'=>1])->find()); + + $this->m_title = '角色查询'; + $this->assign('commonset', M('Kuaijieicon')->where(['url' => 'User/rolelist', 'status' => 1])->find()); $this->display(); @@ -600,47 +662,51 @@ function think_ucenter_md5($str, $key = 'ThinkUCenter'){ * 更新游戏角色数据 * @param $id */ - public function user_update($ids){ + public function user_update($ids) + { $res = D('User')->update_user_player($ids); $this->success("更新成功:{$res['suc']}个,失败:{$res['ero']}"); } + /** * 更新游戏角色数据 * @param $id */ - public function age(){ - if (IS_POST){ + public function age() + { + if (IS_POST) { $data = $_POST; $a = new ToolController(); $re = $a->save($data); - \Think\Log::actionLog('User/age','User',1); + \Think\Log::actionLog('User/age', 'User', 1); $this->success('保存成功'); - }else{ - $data = I('type',1) == 1? C('age'):C('age_prevent'); - $this->assign('data',$data); - $this->meta_title = I('type',1) == 1?"实名认证设置":'防沉迷设置'; - - $this->m_title = I('type',1)==1?'实名认证设置':'防沉迷设置'; - $this->assign('commonset',M('Kuaijieicon')->where(['url'=>'User/age/type/'.I('type',1),'status'=>1])->find()); - + } else { + $data = I('type', 1) == 1 ? C('age') : C('age_prevent'); + $this->assign('data', $data); + $this->meta_title = I('type', 1) == 1 ? "实名认证设置" : '防沉迷设置'; + + $this->m_title = I('type', 1) == 1 ? '实名认证设置' : '防沉迷设置'; + $this->assign('commonset', M('Kuaijieicon')->where(['url' => 'User/age/type/' . I('type', 1), 'status' => 1])->find()); + $this->display(); } - + } - public function update_pwd(){ - if(IS_POST){ - if(strlen($_POST['new_pwd'])<6||strlen($_POST['new_pwd'])>30){ + public function update_pwd() + { + if (IS_POST) { + if (strlen($_POST['new_pwd']) < 6 || strlen($_POST['new_pwd']) > 30) { $this->error('密码格式不正确!'); } - $oldspwd=$this->think_ucenter_md5($_POST['password'],UC_AUTH_KEY); - $newpwd =$this->think_ucenter_md5($_POST['new_pwd'],UC_AUTH_KEY); - $Member=D('UcenterMember'); - $rpwd=$Member->where(array('id'=>session('user_auth.uid')))->find(); - if($oldspwd==$rpwd['password']){ - $Member->where(array('id'=>session('user_auth.uid')))->save(['password'=>$newpwd]); - $this->success('修改成功!',U('User/index')); - }else{ + $oldspwd = $this->think_ucenter_md5($_POST['password'], UC_AUTH_KEY); + $newpwd = $this->think_ucenter_md5($_POST['new_pwd'], UC_AUTH_KEY); + $Member = D('UcenterMember'); + $rpwd = $Member->where(array('id' => session('user_auth.uid')))->find(); + if ($oldspwd == $rpwd['password']) { + $Member->where(array('id' => session('user_auth.uid')))->save(['password' => $newpwd]); + $this->success('修改成功!', U('User/index')); + } else { $this->error('原密码错误!'); } @@ -648,14 +714,14 @@ function think_ucenter_md5($str, $key = 'ThinkUCenter'){ $this->display(); } - public function get_server_lists($game_id=0){ - $server = M("server","tab_"); + public function get_server_lists($game_id = 0) + { + $server = M("server", "tab_"); $map['game_id'] = $game_id; $lists = $server->field('id,server_name,game_name')->where($map)->select(); - if(empty($lists)){ - return $this->ajaxReturn(array('status'=>0,'data'=>'')); + if (empty($lists)) { + return $this->ajaxReturn(array('status' => 0, 'data' => '')); } - return $this->ajaxReturn(array('status'=>1,'data'=>$lists)); + return $this->ajaxReturn(array('status' => 1, 'data' => $lists)); } - } \ No newline at end of file diff --git a/Application/Callback/Controller/Notify3Controller.class.php b/Application/Callback/Controller/Notify3Controller.class.php index 6c3c0e9e6..33d7e65eb 100644 --- a/Application/Callback/Controller/Notify3Controller.class.php +++ b/Application/Callback/Controller/Notify3Controller.class.php @@ -194,6 +194,7 @@ class Notify3Controller extends BaseController $data['type'] = 1; $data['sub_type'] = 1; $data['target_id'] = $promote['id']; + $data['promote_id'] = $promote['id']; $data['target_level'] = $promote['level']; $data['target_type'] = 1; $data['ref_id'] = $order['id']; diff --git a/Application/Home/Controller/QueryController.class.php b/Application/Home/Controller/QueryController.class.php index 255b4d206..2eef90db1 100644 --- a/Application/Home/Controller/QueryController.class.php +++ b/Application/Home/Controller/QueryController.class.php @@ -1709,118 +1709,132 @@ class QueryController extends BaseController $isSelf = I('is_self', 0); $roleName = I('role_name', ''); $userAccount = I('user_account', ''); - $promoteId = I('promote_id', 0); $sdkVersion = I('sdk_version', 0); $costBegin = I('cost_begin', ''); $costEnd = I('cost_end', ''); + $sortName = trim(I('sort_name', '')); + $sort = intval(I('sort', 1)); + $nowTime = date('Y-m-d'); + $initBegTime = date('Y-m-d', strtotime('-6 day', strtotime($nowTime))); + $initBegTime = empty(I('begtime')) ? $initBegTime : I('begtime'); + $initEndTime = $nowTime; + $initEndTime = empty(I('endtime')) ? $initEndTime : I('endtime'); + $begTime = strtotime($initBegTime); + $endTime = strtotime($initEndTime); + $endTime += 3600 * 24; $promote = $this->getLoginPromote(); $levelPromote = $this->getLevelPromote(); $queryPromote = $this->getQueryPromote($levelPromote); - $map[] = [ - '_logic' => 'or', - 'id' => $queryPromote['id'], - 'chain' => ['like', $queryPromote['chain'] . $queryPromote['id'] . '/%'] - ]; - $ids = M('promote', 'tab_')->where($map)->getField('id', true); - - $map = []; - if (count($ids) > 0) { - $map = ['promote_id' => ['in', $ids]]; - } else { - $map['_string'] = '1<>1'; - } + $records = []; + $pagination = ''; + $count = 0; + if (intval($endTime - $begTime) / (24 * 3600) <= 31) { + $map[] = [ + '_logic' => 'or', + 'id' => $queryPromote['id'], + 'chain' => ['like', $queryPromote['chain'] . $queryPromote['id'] . '/%'] + ]; + $ids = M('promote', 'tab_')->where($map)->getField('id', true); - $spendMap = $map; - if ($gameId != 0) { - $map['game_id'] = $gameId; - } - if ($serverId != 0) { - $map['server_id'] = $serverId; - } - if ($roleName != '') { - $map['role_name'] = ['like', '%' . $roleName . '%']; - } - if ($userAccount != '') { - $map['user_account'] = ['like', '%' . $userAccount . '%']; - } - if ($sdkVersion != 0) { - $map['sdk_version'] = $sdkVersion; - } - if ($isSelf) { - $map['promote_id'] = $queryPromote['id']; - $spendMap['promote_id'] = $queryPromote['id']; - } - if ($costBegin != '' || $costEnd != '') { - $having = ''; - if ($costBegin != '' && $costEnd != '') { - $having = 'sum(cost) between ' . $costBegin . ' and ' . $costEnd; - } elseif ($costBegin != '' && $costEnd == '') { - $having = 'sum(cost) >= ' . $costBegin; - } elseif ($costBegin == '' && $costEnd != '') { - $having = 'sum(cost) <= ' . $costEnd; + $map = []; + if (count($ids) > 0) { + $map = ['promote_id' => ['in', $ids]]; + } else { + $map['_string'] = '1<>1'; } - $subMap = $map; - $subMap['pay_status'] = 1; - $subMap['pay_game_status'] = 1; - $subQuery = M('spend', 'tab_')->field('game_player_id')->where($subMap)->group('game_player_id')->having($having)->buildSql(); - $map['_string'] = 'role_id in (' . $subQuery . ')'; - } - $query = M('user_play_info', 'tab_')->where($map)->order('play_time desc'); - list($roles, $pagination, $count) = $this->paginate($query); - $roleIds = array_column($roles, 'role_id'); - $spendMap['pay_status'] = 1; - $spendMap['pay_game_status'] = 1; - if (count($roleIds) > 0) { - $spendMap['game_player_id'] = ['in', $roleIds]; - } else { - $spendMap['_string'] = '1<>1'; - } - $allRecharges = M('spend', 'tab_')->field('count(*) count, sum(cost) cost, game_player_id')->where($spendMap)->group('game_player_id')->select(); - $allRecords = []; - foreach ($allRecharges as $recharge) { - $allRecords[$recharge['game_player_id']] = $recharge; - } + $subMap = []; + if ($gameId != 0) { + $map['game_id'] = $gameId; + $subMap['game_id'] = $gameId; + } + if ($serverId != 0) { + $map['server_id'] = $serverId; + $subMap['server_id'] = $serverId; + } + if ($roleName != '') { + $map['role_name'] = ['like', '%' . $roleName . '%']; + } + if ($userAccount != '') { + $map['user_account'] = ['like', '%' . $userAccount . '%']; + } + if ($sdkVersion != 0) { + $map['sdk_version'] = $sdkVersion; + } + if ($isSelf) { + $map['promote_id'] = $queryPromote['id']; + } - $spendMap['pay_time'] = ['between', [strtotime(date('Y-m-d 00:00:00')), strtotime(date('Y-m-d 23:59:59'))]]; - $todayRecharges = M('spend', 'tab_')->field('sum(cost) cost, game_player_id')->where($spendMap)->group('game_player_id')->select(); - $todayRecords = []; - foreach ($todayRecharges as $recharge) { - $todayRecords[$recharge['game_player_id']] = $recharge; - } + $subMap['create_time'] = ['between', [$begTime, $endTime - 1]]; + if ($costBegin != '' || $costEnd != '') { + $having = ''; + if ($costBegin != '' && $costEnd != '') { + $having = 'sum(recharge_cost) between ' . $costBegin . ' and ' . $costEnd; + } elseif ($costBegin != '' && $costEnd == '') { + $having = 'sum(recharge_cost) >= ' . $costBegin; + } elseif ($costBegin == '' && $costEnd != '') { + $having = 'sum(recharge_cost) <= ' . $costEnd; + } + $subQuery = M('user_play_data_count', 'tab_')->field('role_id') + ->where($subMap) + ->group('game_id,server_id,role_id') + ->having($having) + ->buildSql(); + $map['_string'] = 'role_id in (' . $subQuery . ')'; + } + $spendMap['uc.create_time'] = ['between', [$begTime, $endTime - 1]]; + $spendMap['_string'] = 'uc.game_id = game_id and uc.server_id = server_id and uc.role_id = role_id'; + $sqlCost = M('user_play_data_count', 'tab_')->alias('uc') + ->field('sum(uc.recharge_cost) cost') + ->where($spendMap) + ->buildSql(); + $sqlCount = M('user_play_data_count', 'tab_')->alias('uc') + ->field('sum(uc.recharge_count) count') + ->where($spendMap) + ->buildSql(); + $spendMap['uc.create_time'] = ['between', [strtotime(date('Y-m-d 00:00:00')), strtotime(date('Y-m-d 23:59:59'))]]; + $sqlTodayCost = M('user_play_data_count', 'tab_')->alias('uc') + ->field('sum(uc.recharge_count) count') + ->where($spendMap) + ->buildSql(); + $query = M('user_play_info', 'tab_') + ->field("*,$sqlCost as cost,$sqlCount as count,$sqlTodayCost as today_cost") + ->where($map) + ->order('play_time desc'); + list($roles, $pagination, $count) = $this->paginate($query); - $records = []; - foreach ($roles as $role) { - $records[] = [ - 'user_account' => encryption($role['user_account']), - 'game_name' => $role['game_name'], - 'role_name' => $role['role_name'], - 'role_id' => $role['role_id'], - 'role_level' => $role['role_level'], - 'server_id' => $role['server_id'], - 'server_name' => $role['server_name'], - 'recharge_cost' => isset($allRecords[$role['role_id']]) ? round(floatval($allRecords[$role['role_id']]['cost']), 2) : 0, - 'recharge_count' => isset($allRecords[$role['role_id']]) ? $allRecords[$role['role_id']]['count'] : 0, - 'recharge_cost_today' => isset($todayRecords[$role['role_id']]) ? round(floatval($todayRecords[$role['role_id']]['cost']), 2) : 0, - 'play_time' => $role['play_time'], - 'play_ip' => $role['play_ip'], - 'promote_id' => $role['promote_id'], - 'promote_account' => $role['promote_account'], - 'sdk_version' => $role['sdk_version'], - 'unlogin_day' => intval((strtotime(date('Y-m-d 00:00:00')) - strtotime(date('Y-m-d 00:00:00', $role['play_time']))) / (24 * 3600)) - ]; + foreach ($roles as $role) { + $records[] = [ + 'user_account' => encryption($role['user_account']), + 'game_name' => $role['game_name'], + 'role_name' => $role['role_name'], + 'role_id' => $role['role_id'], + 'role_level' => $role['role_level'], + 'server_id' => $role['server_id'], + 'server_name' => $role['server_name'], + 'recharge_cost' => $role['cost'], + 'recharge_count' => $role['count'], + 'recharge_cost_today' => $role['cost_today'], + 'play_time' => $role['play_time'], + 'play_ip' => $role['play_ip'], + 'promote_id' => $role['promote_id'], + 'promote_account' => $role['promote_account'], + 'sdk_version' => $role['sdk_version'], + 'unlogin_day' => intval((strtotime(date('Y-m-d 00:00:00')) - strtotime(date('Y-m-d 00:00:00', $role['play_time']))) / (24 * 3600)) + ]; + } } $games = $this->getGamesByPromote($promote); $this->assign('games', $games); - $this->assign('promotes', $promotes); - $this->assign('groupPromotes', $groupPromotes); $this->assign('records', $records); $this->assign('pagination', $pagination); $this->assign('count', $count); + $this->assign('initBegTime', $initBegTime); + $this->assign('initEndTime', $initEndTime); $this->display('userRecharges'); } @@ -1906,10 +1920,10 @@ class QueryController extends BaseController public function achievement() { $time = I('time', date('Y-m-d')); - if(!empty($time)) { - $defaultTime = $time ; - }else { - $defaultTime = date('Y-m-d',time()); + if (!empty($time)) { + $defaultTime = $time; + } else { + $defaultTime = date('Y-m-d', time()); } $sdkVersion = I('sdk_version', 0); $gameId = I('game_id', 0); @@ -2000,7 +2014,7 @@ class QueryController extends BaseController $rechargeCountList = $promoteRepository->getRechargeCountByIds($ids, $params); $rechargeUserCountList = $promoteRepository->getRechargeUserCountByIds($ids, $params); $rechargeAmountList = $promoteRepository->getRechargeAmountByIds($ids, $params); - + if (I('p', 1) == 1) { $selfParams = $params; $selfParams['isContainSubs'] = false; @@ -2013,7 +2027,7 @@ class QueryController extends BaseController $selfRechargeCountList = $promoteRepository->getRechargeCountByIds([$parent['id']], $selfParams); $selfRechargeUserCountList = $promoteRepository->getRechargeUserCountByIds([$parent['id']], $selfParams); $selfRechargeAmountList = $promoteRepository->getRechargeAmountByIds([$parent['id']], $selfParams); - + $records[] = [ 'id' => $parent['id'], 'account' => $parent['account'], @@ -2070,7 +2084,7 @@ class QueryController extends BaseController $this->assign('parentid', $parentId); $this->assign('count', $count); $this->assign('timeout', $timeout); - $this->assign('time',$defaultTime); + $this->assign('time', $defaultTime); $this->display(); } @@ -2084,4 +2098,31 @@ class QueryController extends BaseController $this->ajaxReturn($data); } + + public function userPlayDataCount() + { + $time = strtotime(date('Y-m-d 00:00:00',time() - (3600 * 24))); + $spendMap['pay_status'] = 1; + $spendMap['pay_game_status'] = 1; + $spendMap['game_player_id'] = ['gt', 0]; + $spendMap['pay_time'] = ['between', [$time, strtotime(date('Y-m-d 23:59:59', $time))]]; + + $field = 'FROM_UNIXTIME(pay_time,"%Y-%m-%d") as day,game_id,server_id,game_player_id,sum(pay_amount) as recharge_cost,count(id) as recharge_count'; + $spendCostData = M('spend', 'tab_')->field($field) + ->where($spendMap) + ->group('day,game_player_id,server_id,game_id') + ->select(); + + $data = []; + foreach ($spendCostData as $list) { + $save['game_id'] = $list['game_id']; + $save['server_id'] = $list['server_id']; + $save['role_id'] = $list['game_player_id']; + $save['recharge_cost'] = $list['recharge_cost']; + $save['recharge_count'] = $list['recharge_count']; + $save['create_time'] = strtotime($list['day']); + $data[] = $save; + } + M('user_play_data_count', 'tab_')->addAll($data); + } } diff --git a/Application/Home/View/default/Query/userRecharges.html b/Application/Home/View/default/Query/userRecharges.html index 29dd264db..06dce4616 100644 --- a/Application/Home/View/default/Query/userRecharges.html +++ b/Application/Home/View/default/Query/userRecharges.html @@ -1,6 +1,7 @@ + @@ -60,7 +71,19 @@ +
+ +
+ +
+ +
+ +
+
+ +
@@ -77,10 +100,50 @@ 游戏区服 角色名 等级 - 充值总额 - 充值次数 - 今日充值 - 未登录天数 + 充值总额 + + + + + + + + + + + 充值次数 + + + + + + + + + + + 今日充值 + + + + + + + + + + + 未登录天数 + + + + + + + + + + 最后登录时间 组长|推广员 @@ -124,11 +187,41 @@
+ + + + \ No newline at end of file diff --git a/Data/update.sql b/Data/update.sql index b1dd63db4..43633ec18 100644 --- a/Data/update.sql +++ b/Data/update.sql @@ -506,3 +506,25 @@ UPDATE `platform_new`.`tab_quick_menu` SET `url` = '/index.php?s=/Home/TestResou --提现订单 添加索引 ALTER TABLE `tab_withdraw` ADD INDEX `widthdraw_number`(`widthdraw_number`); + +--玩家角色数据统计表 +CREATE TABLE `tab_user_play_data_count` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `game_id` int(11) NOT NULL DEFAULT '0' COMMENT '游戏id', + `server_id` varchar(255) NOT NULL COMMENT '区服id', + `role_id` varchar(255) NOT NULL COMMENT '角色id', + `recharge_cost` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT '充值总额', + `recharge_count` int(10) NOT NULL DEFAULT '0' COMMENT '充值次数', + `create_time` int(10) NOT NULL DEFAULT '0' COMMENT '创建时间', + PRIMARY KEY (`id`), + KEY `recharge_cost` (`recharge_cost`) USING BTREE, + KEY `recharge_count` (`recharge_count`) USING BTREE, + KEY `search` (`game_id`,`server_id`,`role_id`) USING BTREE, + KEY `create_time` (`create_time`) USING BTREE +) ENGINE=InnoDB AUTO_INCREMENT=0 DEFAULT CHARSET=utf8; + +ALTER TABLE `tab_user_play_data_count` +ADD INDEX `search`(`game_id`, `server_id`, `role_id`) USING BTREE, +ADD INDEX `create_time`(`create_time`) USING BTREE; +ADD INDEX `recharge_cost`(`recharge_cost`) USING BTREE, +ADD INDEX `recharge_count`(`recharge_count`) USING BTREE; \ No newline at end of file diff --git a/Public/static/icons_alibaba/iconfont.css b/Public/static/icons_alibaba/iconfont.css index 9cce5fc11..4f48a8e51 100644 --- a/Public/static/icons_alibaba/iconfont.css +++ b/Public/static/icons_alibaba/iconfont.css @@ -1,10 +1,10 @@ @font-face {font-family: "iconfont"; - src: url('iconfont.eot?t=1570870899994'); /* IE9 */ - src: url('iconfont.eot?t=1570870899994#iefix') format('embedded-opentype'), /* IE6-IE8 */ - url('data:application/x-font-woff2;charset=utf-8;base64,d09GMgABAAAAAAVUAAsAAAAADBAAAAUEAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHEIGVgCELAqJGIcgATYCJAMwCxoABCAFhG0HgTsbNQoRFaSZkH1xwJv6gmNIQk1g8ltlso971mEXikzzP0cQrensPSQpkwKU8QWyZWFI1YgIV0Blqmt0hfkvGJGDPGvSVAtI7QFI1ta9YAQAooxJVvi6bJlrytZHmJvybZefHrjA5ZkN4df/jbk69ZD0T6+tl7uJKuKeeDSWiJJ4hCTi2TIhWgiRh23BdhULqzD7pQ8T6LFAGbJv6+wNVDlxVCDujtIjgBqKyDOkoekviQtziAcgaaYUwjqAe/vv4x80gwqSIgPxqGOaTTSYP4MXaij2vwPBaBxgzaVwu4wMm0BOfJCZJ0Dd5k2onk9nolsAQ/KGKBXyTOaZ8XOJ5/jzohdq//9X4JKOUcUZhZNRPwzhxE3lvS8/kMmVCr1C0tDU6uSfV4Lw9CHzpaWXCrR12a2IyKmkESWVDKKgMkb0UosjgloCkahxgll1ISKa1EWIFj9qy/UM6fApYAzEEUB8Mua5K0lm0LNiSENCl5+Tk0tYmDnJThRWX5SRmfMq6+CuKKlqT49tYEeEWL59KbUZiJ0WJra0NoSEtzJeZ+3fFiZW7OiwDe2JkSp3/f0hn5s7P5WXt5DXtxBva+Dx8StKayk5SaMX4a2p3NH5PGxQTEFaGx5Bp2W50gIh7oKkQamt+PXoZkyBTpXhvJdGPnpRaWO2JLUZ6x6dj7Wk8dFL+XjrGXqeESnkZcznBi0r4GGSFfEhJxQG7u97Hxz43Lnjd3h4Rbl8HRIs7+/TWTLCvMyFVzjPOo2NwawkNnoDi3kbn7boUceR6Bgk7aHP4bOg9yDvw8OzvlN3kA6tPbgs7Y6ZjzaIdzAfKkb1wewtm/+xcrBiuiq0s+zX53j/L5rimh7MHpIaErfwFEFNrJh29OXrYgFJBhhrJgsSHyBQXFbWKirWZnYrFtASgDcUpUQkmMxNFjxL+ery2NwR8ysTw5d5P/DsrRscGZ9tvfUM/g/VVI+JXZIYra6R2NmULtFWUx3bAYaqiovJ4erhZI71anVyeGjAZPUE8c8f4oTEJjEc/gCmx2oV6M4Ois4KTtDBK2AXdqYOC0+pdj6Y/ESd1LmTLUj2TNubSfGGDPf3GTXyJl8PNPOPlsk+k7oIU1OEE1lZJwiATWI4/J3nlDY3FaVp+oSk/v4kdBJ4lJDEivo06Vr6+3B7G4Du/VSj4rZyukRRC35mFRjhBxrXXIo+Q2kUli5zXP8h2Sg7r/uZJPTcOEgV3/s+jM34K5XpeFnzvTR0npW7GBGa66EpUdh6JlgLLsi/dhHty99zo0cK9Gk7jRoTemSB7r8w4l4XvvHCvQlN4z4kDfOQaVqk5sxNKPRqQ6lpC3pssLu816hzgIqcAViXABCGdEEy4AsyQzaoOfMuFCa8hdJQoNDjEuG6Ya9lfNDDK6MSXEAfgUxOVsXlwen7ha4FxUG7Lf9DrlQHUz9G2z4xITdxSt25WcSC5RzhAx6HIWQonLdopF9FymYYLPVGvcnx7MEroxJcgD4CMjlZs7o8xH7/C10LijOm/Jj+IVfaPpj0xgLUT08qNOVQBtedmwlrtMDeeucIPlgKg2zOoND7bdFIb63QWDYGtpQt6um798U9bj+8phGfzhwlumFatuN6Pn97vlXJHSi5PdKhqXRac3IvCY5Ho6UQbt4Hro1uHSa3tHz7S003LsctND2W0GpniE3Ap0jp06P+N8WYaH05r1W5hOP91nftBKucnQEAAAA=') format('woff2'), - url('iconfont.woff?t=1570870899994') format('woff'), - url('iconfont.ttf?t=1570870899994') format('truetype'), /* chrome, firefox, opera, Safari, Android, iOS 4.2+ */ - url('iconfont.svg?t=1570870899994#iconfont') format('svg'); /* iOS 4.1- */ + src: url('iconfont.eot?t=1574318572037'); /* IE9 */ + src: url('iconfont.eot?t=1574318572037#iefix') format('embedded-opentype'), /* IE6-IE8 */ + url('data:application/x-font-woff2;charset=utf-8;base64,d09GMgABAAAAAAXEAAsAAAAADNQAAAV3AAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHEIGVgCEXgqJfIdpATYCJAM8CyAABCAFhG0HgVgb2QrIDiUFOVaVJ6RZZvD85191X1W1MLCyWTi1uxfA72xhR8yYA/oz62izPfv/9736O9OFkN1HsdMmabbwgp1H8tfnH9TVfr/6xRANSRdv9HL3RO8YFhWLNH5CPDGEJOKRoTOEaClFTMKz10xIKn+FiY9DAD/5NMbXu+/g0RCBgY8TQGZOozxExNIwBSGCN9mtuNQgW3HhVevULWCL+/fyg2aJAIVLw0/qH+sjQnebzt7aczxG65lY3eUAi6tAA7UABuS0Mu8oaL+uFg7/7n0MCwGSSYBD2WKX2e0dRR2JV2tfN+vs7ThgY5emrYXWNbaeo3FLIZkU0sSaYc36Bx6gMbhxEUZQePDiw0+AICEQNzCD5LxRHwYbMxEabEEMWCkQN1gZEBdYOxIRho7CRAh0FCEKLAHEA7YbiBdsDxLhg86GRPihsycSAOsFJAjWG30IARCxL8kHyARkECAPYD7T1ZU4xa65pFJUlGJnJien5OYGs6Mmx8Aoja8ZTF4Wd+ZRnmvr43aR0w9zzaYHxevPgrHORcdvuOALTZyPqgifepBjNj9sEzn7ON+15dH44bAqJXXngrT03WlD1yQO7k4dMm7thv3r1RhdmziwIGXyqjTpMWX1hoNBPk6K9IURTN2V1WP9gWDF5H1WA3XOxmDarCY9vnb/nuLg9fu8tuIqa//C9HgtntZO7wVRvt3p/lWpmKGrUwOhazPklDUjnzwZ/fTpmOfPxz17VmroYz0aLX3yhIYKUtODleeww+exeXI4NBLvYGZ652NWfe4MEaf4Fn4c88yeFMcgxqZhWkHESX31GP3smTn06nPf4NJortrwvNuQ1oAsb4zX846x3G3P/g8nhj3TK7Tq4rdvG+woaS5sHhAzorhF0erguqxmax2Z9ubHusxiH6R65zFNd8vau3HjgbyCC3abdZktWbxXWdYHZq/1mZd1XuNJJRfvSt1LL98oSf+cVuLcQrp050C1jXP22LaL+YsLLmzbLsTbMl5wcPu21C5wfeu6dWHTG6eHETHnN3dPj3W7cvRyyP//5rIQm1pq2C3wrOEQd/8hB20zUahUBv3GGW2IlNP08uOzH25mtz3fyrR4vP2Np3r1puF/Nm2X/X88bbmTHSi3SxZBt5tseFYadIuUQTvXlgTVfmXLFoU0NadQw91vNrp3r2FprL1/7pVTc6EpSvfP1Yvbx2rvUH8f1rwDcB7poxq5EddUvu7hp++Ee+o3N7Nug36pYyoiends/KyX6QTSPVRbAAhQ3XULlX/0XP3LOgxx8idOi+/81xv9Z1vw8t/I91TqeAaGaYcXBZWl35FUcZrZK5weMdvJN49AgAitcJ+YHPBLEThUlMzD4Xha5Y4geEkLQeEhDzReSq3GWQsuArSCGy/dwE8N/a4OkIIFhxgfUM1sDYQoR0ER5iZooty2GucDcJHOB3ATFQ78DJXkWwYoF+bvNR/zDhZRoAwxQdeIkelEeZ1HYuoqvBVV3LCx2LJZJWpR35hs7Ic1bHVxhl1MWzoOQcTSVdRXexpWFB0Zll6EBaep5DhGx2YNMdUHNRV0FaLohQWGxwEjgghQBoIhoKNBbO8OUanfHwmG4qLAYxWMuks6FoyFDds5ogVNaV7B2s/UKo06lZ42xVBa4ug1BARZdNRRQfTVczCK1OkgDPVBRWAEHJoiNagx6EgzfTZS1Ww6PFcf9xWAH/6kiCjRYsQlbvGIV3zil4AEJSRhiUiUlBiv0VKm0RLMSl1eK5d0jaZmqKsawhQlbHuo5LJwOkWjoquHH3JahNESdwiwaGOmazcRmCUoOEadpu3a2abLWzhT2mihRm9DKQux51hOpNWmiaiXaOF+rmtEPhitmzjYdgAA') format('woff2'), + url('iconfont.woff?t=1574318572037') format('woff'), + url('iconfont.ttf?t=1574318572037') format('truetype'), /* chrome, firefox, opera, Safari, Android, iOS 4.2+ */ + url('iconfont.svg?t=1574318572037#iconfont') format('svg'); /* iOS 4.1- */ } .iconfont { @@ -55,6 +55,18 @@ content: "\e82f"; } +.iconsort:before { + content: "\e842"; +} + +.iconsort-down:before { + content: "\e843"; +} + +.iconsort-up:before { + content: "\e844"; +} + .iconicon-test:before { content: "\e63c"; } diff --git a/Public/static/icons_alibaba/iconfont.eot b/Public/static/icons_alibaba/iconfont.eot index e738345bf..fc5f6ff13 100644 Binary files a/Public/static/icons_alibaba/iconfont.eot and b/Public/static/icons_alibaba/iconfont.eot differ diff --git a/Public/static/icons_alibaba/iconfont.js b/Public/static/icons_alibaba/iconfont.js index ca21a83cc..9c02c96ce 100644 --- a/Public/static/icons_alibaba/iconfont.js +++ b/Public/static/icons_alibaba/iconfont.js @@ -1 +1 @@ -!function(a){var t,c='',e=(t=document.getElementsByTagName("script"))[t.length-1].getAttribute("data-injectcss");if(e&&!a.__iconfont__svg__cssinject__){a.__iconfont__svg__cssinject__=!0;try{document.write("")}catch(t){console&&console.log(t)}}!function(t){if(document.addEventListener)if(~["complete","loaded","interactive"].indexOf(document.readyState))setTimeout(t,0);else{var e=function(){document.removeEventListener("DOMContentLoaded",e,!1),t()};document.addEventListener("DOMContentLoaded",e,!1)}else document.attachEvent&&(o=t,n=a.document,i=!1,(l=function(){try{n.documentElement.doScroll("left")}catch(t){return void setTimeout(l,50)}c()})(),n.onreadystatechange=function(){"complete"==n.readyState&&(n.onreadystatechange=null,c())});function c(){i||(i=!0,o())}var o,n,i,l}(function(){var t,e;(t=document.createElement("div")).innerHTML=c,c=null,(e=t.getElementsByTagName("svg")[0])&&(e.setAttribute("aria-hidden","true"),e.style.position="absolute",e.style.width=0,e.style.height=0,e.style.overflow="hidden",function(t,e){e.firstChild?function(t,e){e.parentNode.insertBefore(t,e)}(t,e.firstChild):e.appendChild(t)}(e,document.body))})}(window); \ No newline at end of file +!function(a){var t,o='',e=(t=document.getElementsByTagName("script"))[t.length-1].getAttribute("data-injectcss");if(e&&!a.__iconfont__svg__cssinject__){a.__iconfont__svg__cssinject__=!0;try{document.write("")}catch(t){console&&console.log(t)}}!function(t){if(document.addEventListener)if(~["complete","loaded","interactive"].indexOf(document.readyState))setTimeout(t,0);else{var e=function(){document.removeEventListener("DOMContentLoaded",e,!1),t()};document.addEventListener("DOMContentLoaded",e,!1)}else document.attachEvent&&(c=t,i=a.document,l=!1,(n=function(){try{i.documentElement.doScroll("left")}catch(t){return void setTimeout(n,50)}o()})(),i.onreadystatechange=function(){"complete"==i.readyState&&(i.onreadystatechange=null,o())});function o(){l||(l=!0,c())}var c,i,l,n}(function(){var t,e;(t=document.createElement("div")).innerHTML=o,o=null,(e=t.getElementsByTagName("svg")[0])&&(e.setAttribute("aria-hidden","true"),e.style.position="absolute",e.style.width=0,e.style.height=0,e.style.overflow="hidden",function(t,e){e.firstChild?function(t,e){e.parentNode.insertBefore(t,e)}(t,e.firstChild):e.appendChild(t)}(e,document.body))})}(window); \ No newline at end of file diff --git a/Public/static/icons_alibaba/iconfont.svg b/Public/static/icons_alibaba/iconfont.svg index 3a3f91969..e098e00a7 100644 --- a/Public/static/icons_alibaba/iconfont.svg +++ b/Public/static/icons_alibaba/iconfont.svg @@ -50,6 +50,15 @@ Created by iconfont + + + + + + + + + diff --git a/Public/static/icons_alibaba/iconfont.ttf b/Public/static/icons_alibaba/iconfont.ttf index fe69cbe05..552caa9fc 100644 Binary files a/Public/static/icons_alibaba/iconfont.ttf and b/Public/static/icons_alibaba/iconfont.ttf differ diff --git a/Public/static/icons_alibaba/iconfont.woff b/Public/static/icons_alibaba/iconfont.woff index 26361367d..7ac524679 100644 Binary files a/Public/static/icons_alibaba/iconfont.woff and b/Public/static/icons_alibaba/iconfont.woff differ diff --git a/Public/static/icons_alibaba/iconfont.woff2 b/Public/static/icons_alibaba/iconfont.woff2 index c3d731404..649a6d02f 100644 Binary files a/Public/static/icons_alibaba/iconfont.woff2 and b/Public/static/icons_alibaba/iconfont.woff2 differ