Merge remote-tracking branch 'origin/dev' into dev_lww

master
“用lww 5 years ago
commit 6e1db7caa6

@ -890,5 +890,31 @@ public function auto_rrdae(){
}
}
//根据时间统计玩家充值
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);
}
}

@ -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 '';
}
}
}

@ -126,4 +126,53 @@ class ConsoleController extends Think {
}
}
}
public function deleteRepeatUserPlayInfo()
{
// $gameId = 157;
// $gameId = 155;
$gameId = 153;
$sql = 'select id from tab_user_play_info a left join (
select role_id, server_id, game_id, count(1) from tab_user_play_info where server_id="' . $serverId . '" and game_id = ' . $gameId . ' GROUP BY role_id, server_id, game_id, server_name having count(1) > 1
) b on a.role_id=b.role_id where a.server_id=b.server_id and a.game_id=b.game_id and a.server_id="' . $serverId . '" and a.game_id = ' . $gameId . ' order by a.role_id, a.server_id, a.game_id';
$model = new \Think\Model();
$servers = M('server', 'tab_')->field('server_id')->where(['game_id' => $gameId])->group('server_id')->select();
foreach ($servers as $server) {
$serverId = $server['server_id'];
$sql = 'select a.id, a.role_id, a.server_id, a.game_id, a.role_level from tab_user_play_info a left join (
select role_id, server_id, game_id, count(1) from tab_user_play_info where server_id="' . $serverId . '" and game_id = ' . $gameId . ' GROUP BY role_id, server_id, game_id, server_name having count(1) > 1
) b on a.role_id=b.role_id where a.server_id=b.server_id and a.game_id=b.game_id and a.server_id="' . $serverId . '" and a.game_id = ' . $gameId . ' order by a.role_id, a.server_id, a.game_id';
// var_dump($sql);
$result = $model->query($sql);
$uniqueRole = null;
$items = [];
foreach ($result as $item) {
$items[$item['role_id']][] = $item;
}
$maxRoleIds = [];
$repeatIds = [];
foreach ($items as $roles) {
$maxRole = null;
foreach ($roles as $role) {
if ($maxRole == null) {
$maxRole = $role;
} elseif ($role['role_level'] > $maxRole['role_level']) {
$repeatIds[] = $maxRole['id'];
$maxRole = $role;
} else {
$repeatIds[] = $role['id'];
}
}
$maxRoleIds[] = $maxRole['id'];
}
if (count($repeatIds) > 0) {
M('user_play_info', 'tab_')->where(['id' => ['in', $repeatIds], 'game_id' => $gameId, 'server_id' => $serverId])->delete();
echo M()->getLastSql();
echo PHP_EOL;
}
}
}
}

@ -417,7 +417,133 @@ class PlatformController extends ThinkController
$this->assign('total', $total);
$this->display();
}
//TODO:
function promotepay_statistics($p = 0)
{
$page = intval($p);
$page = $page ? $page : 1; //默认显示第一页数据
$arraypage = $page;
if (isset($_REQUEST['row'])) {
$row = $_REQUEST['row'];
} else {
$row = 10;
}
$map1['promote_id'] = $map['promote_id'] = array('egt', 0);
$spend = M('Spend', 'tab_');
if (!empty($_REQUEST['timestart']) && !empty($_REQUEST['timeend'])) {
$map['create_time'] = ['between', array(strtotime($_REQUEST['timestart']), strtotime($_REQUEST['timeend']) + 86399)];
$pay_time = " between " . strtotime($_REQUEST['timestart']) . " and " . (strtotime($_REQUEST['timeend']) + 86399) . " ";
unset($_REQUEST['timestart']);
unset($_REQUEST['timeend']);
} elseif (!empty($_REQUEST['timestart']) && empty($_REQUEST['timeend'])) {
$map['create_time'] = ['between', array(strtotime($_REQUEST['timestart']), time())];
$pay_time = " between " . strtotime($_REQUEST['timestart']) . " and " . time() . " ";
unset($_REQUEST['timestart']);
} elseif (empty($_REQUEST['timestart']) && !empty($_REQUEST['timeend'])) {
$map['create_time'] = ['elt', strtotime($_REQUEST['timeend']) + 86399];
$pay_time = " between 0 and " . (strtotime($_REQUEST['timeend']) + 86399) . " ";
unset($_REQUEST['timeend']);
} else {
$pay_time = " between 0 and " . time();
}
$map1['pay_status'] = $map['pay_status'] = 1;
$today = total(1);
$week = total(2);
$mounth = total(3);
unset( $map['create_time']);
//获取所有会长
$promote_map = "`chain` = '/'";
if (isset($_REQUEST['promote_id'])) {
$promote_map = "`chain` = '%/{$_REQUEST['promote_id']}/%' OR id = {$_REQUEST['promote_id']}";
}
$promote = M("promote","tab_")->field("id,account")->page($page,$row)->where($promote_map)->select();
$pcount = M("promote","tab_")->field("count(*) acount")->where($promote_map)->find()['acount'];
// var_dump( $promote);
$data =array();
for ($i=0; $i < count($promote); $i++) {
# code...
$proid = M("promote","tab_")->field("id")->where("`chain` like '%/{$promote[$i]['id']}/%'")->select();
$str = '';
for($k=0; $k<count($proid); $k++){
# code...
$str .= ($proid[$k]['id'].",");
}
$str .= "{$promote[$i]['id']}";
$map['promote_id'] = array("in",$str);
if (isset($_REQUEST['game_name'])) {
$map['game_name'] = $_REQUEST['game_name'];
if (isset($_REQUEST['server_id'])) {
$map['server_name'] = $_REQUEST['server_id'];
unset($_REQUEST['server_id']);
}
$dbdata = $spend
->field('
floor(sum(IF(pay_time ' . $pay_time . ',pay_amount,0))*100) as count,
floor(sum(IF(pay_time ' . $today . ',pay_amount,0))*100) as today,
floor(sum(IF(pay_time ' . $week . ',pay_amount,0))*100) as week,
floor(sum(IF(pay_time ' . $mounth . ',pay_amount,0))*100) as mounth')
->where($map)
->where("pay_time".$pay_time)
->find();
$dbdata['promote_account'] = $promote[$i]['account'];
$dbdata['promote_id'] = $promote[$i]['id'];
} else {
$dbdata = $spend
->field('
floor(sum(IF(pay_time ' . $pay_time . ',pay_amount,0))*100) as count,
floor(sum(IF(pay_time ' . $today . ',pay_amount,0))*100) as today,
floor(sum(IF(pay_time ' . $week . ',pay_amount,0))*100) as week,
floor(sum(IF(pay_time ' . $mounth . ',pay_amount,0))*100) as mounth')
->where($map)
->where("pay_time".$pay_time)
->find();
$dbdata['promote_account'] = $promote[$i]['account'];
$dbdata['promote_id'] = $promote[$i]['id'];
}
$data[] = $dbdata;
}
$count = count($data);
foreach ($data as $key => $value) {
$value['count'] ?: 0;
$value['today'] ?: 0;
$value['week'] ?: 0;
$value['mounth'] ?: 0;
static $i = 0;
$i++;
$data[$key]['rand'] = $i;
$data[$key]['count'] = $value['count'] / 100;
$data[$key]['today'] = $value['today'] / 100;
$data[$key]['week'] = $value['week'] / 100;
$data[$key]['mounth'] = $value['mounth'] / 100;
}
$total = $this->data_total($data);
$this->assign('total', $total);
if ($_REQUEST['data_order'] != '') {
$data_order = reset(explode(',', $_REQUEST['data_order']));
$data_order_type = end(explode(',', $_REQUEST['data_order']));
$this->assign('userarpu_order', $data_order);
$this->assign('userarpu_order_type', $data_order_type);
}
$page = set_pagination($pcount, $row);
if ($page) {
$this->assign('_page', $page);
}
$data = my_sort($data, $data_order_type, (int)$data_order);
$size = $row;//每页显示的记录数
$pnum = ceil(count($data) / $size); //总页数ceil()函数用于求大于数字的最小整数
$this->meta_title = '渠道充值统计列表';
$this->assign('list_data', $data);
$this->display();
}
function promotepay_statistics_1($p = 0)
{
$page = intval($p);
$page = $page ? $page : 1; //默认显示第一页数据
@ -504,10 +630,9 @@ class PlatformController extends ThinkController
unset($_REQUEST['promote_id']);
}
$data = $spend->field('t.pid as promote_id,t.promote_account,sum(a.scount) AS count,sum(a.today) AS today,sum(a. WEEK) AS WEEK,sum(a.mounth) AS mounth')
->join("INNER JOIN (SELECT tp2.*, tp1.id AS pid, tp1.account as promote_account FROM tab_promote tp1 LEFT JOIN tab_promote tp2 ON tp2.`chain` LIKE CONCAT('%/', tp1.id, '/%') OR tp1.id = tp2.id where $promote_map ) AS t ON promote_id = t.id or promote_id = t.pid")
->join("inner JOIN (SELECT tp2.*, tp1.id AS pid, tp1.account as promote_account FROM tab_promote tp1 LEFT JOIN tab_promote tp2 ON tp2.`chain` LIKE CONCAT('%/', tp1.id, '/%') where $promote_map ) AS t ON promote_id = t.id or promote_id = t.pid")
->where($condition)->table('(' . $data . ') as a')->group('t.pid')->order('count desc,a.ordertime')->select();
$count = count($data);
foreach ($data as $key => $value) {
static $i = 0;
$i++;

@ -100,6 +100,7 @@ class SpendController extends ThinkController
$map = '1 = 2';
$map1 = $map;
}
echo (D(self::model_name)->where($map1)->fetchSql(true)->sum('pay_amount'));
$total = null_to_0(D(self::model_name)->where($map1)->sum('pay_amount'));
$ttotal = null_to_0(D(self::model_name)->where('pay_time' . total(1))->where(array('pay_status' => 1))->sum('pay_amount'));
$ytotal = null_to_0(D(self::model_name)->where('pay_time' . total(5))->where(array('pay_status' => 1))->sum('pay_amount'));

@ -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 麦当苗儿 <zuojiazi@vip.qq.com>
*/
class UserController extends AdminController {
class UserController extends AdminController
{
/**
* 用户管理首页
* @author 麦当苗儿 <zuojiazi@vip.qq.com>
*/
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 <banhuajie@163.com>
*/
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 <banhuajie@163.com>
*/
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 <banhuajie@163.com>
*/
public function updatePassword(){
public function updatePassword()
{
$this->meta_title = '修改密码';
$this->display('updatepassword');
}
@ -104,24 +110,25 @@ class UserController extends AdminController {
* 修改密码提交
* @author huajie <banhuajie@163.com>
*/
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 <banhuajie@163.com>
*/
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 <banhuajie@163.com>
*/
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 <banhuajie@163.com>
*/
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 <banhuajie@163.com>
*/
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 朱亚杰 <zhuyajie@topthink.net>
*/
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 朱亚杰 <zhuyajie@topthink.net>
*/
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));
}
}

@ -1 +1 @@
{"news":[{"time":"0:00","count":0},{"time":"1:00","count":0},{"time":"2:00","count":1},{"time":"3:00","count":0},{"time":"4:00","count":0},{"time":"5:00","count":0},{"time":"6:00","count":0},{"time":"7:00","count":0},{"time":"8:00","count":0},{"time":"9:00","count":1},{"time":"10:00","count":0},{"time":"11:00","count":2},{"time":"12:00","count":0},{"time":"13:00","count":0},{"time":"14:00","count":3},{"time":"15:00","count":1},{"time":"16:00","count":1},{"time":"17:00","count":1},{"time":"18:00","count":3},{"time":"19:00","count":0},{"time":"20:00","count":2},{"time":"21:00","count":0},{"time":"22:00","count":3},{"time":"23:00","count":2}],"sum":{"news":20,"active":43,"player":10,"money":50.059999999999995},"active":[{"time":"0:00","count":0},{"time":"1:00","count":0},{"time":"2:00","count":2},{"time":"3:00","count":0},{"time":"4:00","count":0},{"time":"5:00","count":0},{"time":"6:00","count":0},{"time":"7:00","count":0},{"time":"8:00","count":0},{"time":"9:00","count":2},{"time":"10:00","count":3},{"time":"11:00","count":7},{"time":"12:00","count":1},{"time":"13:00","count":1},{"time":"14:00","count":4},{"time":"15:00","count":1},{"time":"16:00","count":1},{"time":"17:00","count":3},{"time":"18:00","count":5},{"time":"19:00","count":0},{"time":"20:00","count":2},{"time":"21:00","count":1},{"time":"22:00","count":8},{"time":"23:00","count":2}],"player":[{"time":"0:00","count":0},{"time":"1:00","count":0},{"time":"2:00","count":0},{"time":"3:00","count":0},{"time":"4:00","count":0},{"time":"5:00","count":0},{"time":"6:00","count":0},{"time":"7:00","count":0},{"time":"8:00","count":0},{"time":"9:00","count":0},{"time":"10:00","count":1},{"time":"11:00","count":1},{"time":"12:00","count":0},{"time":"13:00","count":0},{"time":"14:00","count":1},{"time":"15:00","count":3},{"time":"16:00","count":2},{"time":"17:00","count":1},{"time":"18:00","count":0},{"time":"19:00","count":0},{"time":"20:00","count":0},{"time":"21:00","count":0},{"time":"22:00","count":0},{"time":"23:00","count":1}],"money":[{"time":"0:00","count":0},{"time":"1:00","count":0},{"time":"2:00","count":0},{"time":"3:00","count":0},{"time":"4:00","count":0},{"time":"5:00","count":0},{"time":"6:00","count":0},{"time":"7:00","count":0},{"time":"8:00","count":0},{"time":"9:00","count":0},{"time":"10:00","count":"1.01"},{"time":"11:00","count":"9.00"},{"time":"12:00","count":0},{"time":"13:00","count":0},{"time":"14:00","count":"0.01"},{"time":"15:00","count":"10.01"},{"time":"16:00","count":"11.02"},{"time":"17:00","count":"14.00"},{"time":"18:00","count":0},{"time":"19:00","count":0},{"time":"20:00","count":0},{"time":"21:00","count":0},{"time":"22:00","count":0},{"time":"23:00","count":"5.01"}]}
{"news":[{"time":"0:00","count":1},{"time":"1:00","count":0},{"time":"2:00","count":0},{"time":"3:00","count":0},{"time":"4:00","count":0},{"time":"5:00","count":0},{"time":"6:00","count":0},{"time":"7:00","count":0},{"time":"8:00","count":0},{"time":"9:00","count":0},{"time":"10:00","count":1},{"time":"11:00","count":1},{"time":"12:00","count":1},{"time":"13:00","count":1},{"time":"14:00","count":12},{"time":"15:00","count":1},{"time":"16:00","count":3},{"time":"17:00","count":0},{"time":"18:00","count":0},{"time":"19:00","count":2},{"time":"20:00","count":6},{"time":"21:00","count":0},{"time":"22:00","count":0},{"time":"23:00","count":0}],"sum":{"news":29,"active":49,"player":7,"money":13.17},"active":[{"time":"0:00","count":2},{"time":"1:00","count":0},{"time":"2:00","count":0},{"time":"3:00","count":0},{"time":"4:00","count":0},{"time":"5:00","count":0},{"time":"6:00","count":0},{"time":"7:00","count":0},{"time":"8:00","count":1},{"time":"9:00","count":4},{"time":"10:00","count":7},{"time":"11:00","count":1},{"time":"12:00","count":4},{"time":"13:00","count":2},{"time":"14:00","count":12},{"time":"15:00","count":3},{"time":"16:00","count":5},{"time":"17:00","count":0},{"time":"18:00","count":0},{"time":"19:00","count":2},{"time":"20:00","count":6},{"time":"21:00","count":0},{"time":"22:00","count":0},{"time":"23:00","count":0}],"player":[{"time":"0:00","count":0},{"time":"1:00","count":0},{"time":"2:00","count":0},{"time":"3:00","count":0},{"time":"4:00","count":0},{"time":"5:00","count":0},{"time":"6:00","count":0},{"time":"7:00","count":0},{"time":"8:00","count":0},{"time":"9:00","count":0},{"time":"10:00","count":0},{"time":"11:00","count":0},{"time":"12:00","count":0},{"time":"13:00","count":1},{"time":"14:00","count":2},{"time":"15:00","count":0},{"time":"16:00","count":0},{"time":"17:00","count":0},{"time":"18:00","count":0},{"time":"19:00","count":1},{"time":"20:00","count":2},{"time":"21:00","count":1},{"time":"22:00","count":0},{"time":"23:00","count":0}],"money":[{"time":"0:00","count":0},{"time":"1:00","count":0},{"time":"2:00","count":0},{"time":"3:00","count":0},{"time":"4:00","count":0},{"time":"5:00","count":0},{"time":"6:00","count":0},{"time":"7:00","count":0},{"time":"8:00","count":0},{"time":"9:00","count":0},{"time":"10:00","count":0},{"time":"11:00","count":0},{"time":"12:00","count":0},{"time":"13:00","count":"6.01"},{"time":"14:00","count":"3.08"},{"time":"15:00","count":0},{"time":"16:00","count":0},{"time":"17:00","count":0},{"time":"18:00","count":0},{"time":"19:00","count":"4.02"},{"time":"20:00","count":"0.05"},{"time":"21:00","count":"0.01"},{"time":"22:00","count":0},{"time":"23:00","count":0}]}

@ -96,7 +96,7 @@
<th ><a class="paixu" date-url='lzhuce'>累计充值</a></th>
<th ><a class="paixu" date-url='phb'>排行榜</a></th>
<!-- <th ><a class="paixu" date-url='phb'>排行榜</a></th> -->
<th ><a class="paixu" date-url='dzhuce'>今日充值</a></th>
@ -120,8 +120,8 @@
<volist name="list_data" id="data">
<tr>
<td >{$data['promote_account']}</td>
<td ><span class='ljcz' data-value='{$data["promote_id"]}'><a>{$data.count}</a></span></td>
<td ><strong><if condition="$data.rand eq 1"><span>{$data.rand}</span><elseif condition="$data.rand eq 2"/><span>{$data.rand}</span><elseif condition="$data.rand eq 3"/><span>{$data.rand}</span><else/>{$data.rand}</if></strong></td>
<td ><span class='ljcz' data-value="{$data['promote_id']}"><a>{$data.count}</a></span></td>
<!-- <td ><strong><if condition="$data.rand eq 1"><span>{$data.rand}</span><elseif condition="$data.rand eq 2"/><span>{$data.rand}</span><elseif condition="$data.rand eq 3"/><span>{$data.rand}</span><else/>{$data.rand}</if></strong></td> -->
<td >{$data.today}</td>
<td >{$data.week}</td>
<td >{$data.mounth}</td>
@ -131,7 +131,7 @@
<tr class="data_summary">
<td><span>汇总</span></td>
<td ><span>{$total.sum_count}</span></td>
<td>---</td>
<!-- <td>---</td> -->
<td>{$total.sum_today}</td>
<td>{$total.sum_week}</td>
<td>{$total.sum_mounth}</td>

@ -124,7 +124,7 @@
<notempty name="list">
<volist name="list" id="data">
<tr>
<td>{$data.play_time|date='Y-m-d H:i:s',###}</td>
<td>{$data.create_time|date='Y-m-d H:i:s',###}</td>
<td>{$data.user_account} </td>
<?php $gamename = trim($data['game_name']);
$servername = trim($data['server_name']);

@ -106,7 +106,6 @@ class PromoteRepository {
$params['time_column'] = 'create_time';
$map = $this->getPublicAchievementMap($ids, $params);
$items = M('user_play_info', 'tab_')->field(['count(distinct user_id) count', 'promote_id'])->where($map)->group('promote_id')->select();
$records = [];
foreach ($items as $item) {
$promoteId = $item['promote_id'];
@ -119,7 +118,6 @@ class PromoteRepository {
$records[$promoteId] = $item['count'];
}
}
$records = $this->assembleZero($ids, $records, 0);
return $records;
@ -162,7 +160,7 @@ class PromoteRepository {
}
}
$records = $this->assembleZero($ids, [], 0);
$records = $this->assembleZero($ids, $records, 0);
return $records;
}
@ -188,7 +186,7 @@ class PromoteRepository {
$inQuery = M('user_play_info', 'tab_')->field('create_ip')->group('create_ip')->where($map)->buildSql();
$resultMap = ['create_ip' => ['exp', ' in (' . $inQuery . ')']];
$items = M('user_play_info', 'tab_')->field(['count(*) count', 'promote_id'])->where($resultMap)->group('promote_id')->select();
$items = M('user_play_info', 'tab_')->field(['count(DISTINCT create_ip) count', 'promote_id'])->where($resultMap)->group('promote_id')->select();
$records = [];
foreach ($items as $item) {
@ -203,7 +201,7 @@ class PromoteRepository {
}
}
$records = $this->assembleZero($ids, [], 0);
$records = $this->assembleZero($ids, $records, 0);
return $records;
}
@ -233,7 +231,8 @@ class PromoteRepository {
$inQuery = M('user_play_info', 'tab_')->field('user_id')->group('user_id')->where($map)->buildSql();
$resultMap = ['_string' => 'user_id in (' . $inQuery . ')'];
$items = M('user_play_info', 'tab_')->field(['count(*) count', 'promote_id'])->where($resultMap)->group('promote_id')->select();
$items = M('user_play_info', 'tab_')->field(['count(DISTINCT user_id) count', 'promote_id'])->where($resultMap)->group('promote_id')->select();
// var_dump(M()->getLastSql());
$records = [];
foreach ($items as $item) {
$promoteId = $item['promote_id'];
@ -247,7 +246,7 @@ class PromoteRepository {
}
}
$records = $this->assembleZero($ids, [], 0);
$records = $this->assembleZero($ids, $records, 0);
return $records;
}
@ -370,6 +369,7 @@ class PromoteRepository {
$params['time_column'] = 'pay_time';
$map = $this->getPublicAchievementMap($ids, $params);
$map['pay_status'] = 1;
$items = M('spend', 'tab_')->field(['sum(pay_amount) amount', 'promote_id', 'pay_way'])->where($map)->group('promote_id, pay_way')->select();
// echo M()->getLastSql();die();
$records = [];

@ -133,8 +133,13 @@ class UserRepository
$dayList = $params['dayList'] ?? [];
$params['time_column'] = 'create_time';
$conditions = $this->getDayGroupConditions($params);
$items = M('login_daily_record', 'tab_')->field('FROM_UNIXTIME(create_time, "%Y-%m-%d") as day, count(DISTINCT user_id, game_id) as count')
$subQuery = M('login_daily_record', 'tab_')->field('FROM_UNIXTIME(create_time, "%Y-%m-%d") as day,count(DISTINCT user_id) as count')
->where($conditions)
->group('game_id')
->buildSql();
$items = M()->field('*,sum(count) as count')
->table($subQuery)
->alias('a')
->group('day')
->select();
@ -294,8 +299,13 @@ class UserRepository
$params['time_column'] = 'create_time';
$conditions = $this->getCreateRoleConditions($params);
$items = M('user_play_info', 'tab_')->field('count(distinct game_id,user_id) count, FROM_UNIXTIME(create_time, "%Y-%m-%d") as day')
$subQuery = M('user_play_info', 'tab_')->field('FROM_UNIXTIME(create_time, "%Y-%m-%d") as day,count(DISTINCT user_id) as count')
->where($conditions)
->group('game_id')
->buildSql();
$items = M()->field('*,sum(count) as count')
->table($subQuery)
->alias('a')
->group('day')
->select();
return $this->assembleRecords($items, $dayList, 'count');
@ -346,10 +356,14 @@ class UserRepository
->where("ti.user_id = user_id and ti.game_id = game_id and ti.create_time < " . $params['begin_time'])
->fetchSql(true)
->count();
$items = $model->field("count(distinct game_id,user_id) count, FROM_UNIXTIME(create_time, '%Y-%m-%d') as day,
(" . $sql . ") as num")
$subQuery = $model->field('FROM_UNIXTIME(create_time, "%Y-%m-%d") as day,count(DISTINCT user_id) as count')
->where($conditions)
->group("day")
->group('game_id')
->buildSql();
$items = M()->field("*,sum(count) as count,(" . $sql . ") as num")
->table($subQuery)
->alias('a')
->group('day')
->having('num = 0')
->select();
return $this->assembleRecords($items, $dayList, 'count');
@ -411,10 +425,14 @@ class UserRepository
->where("ti.create_device_number = create_device_number and ti.game_id = game_id and ti.create_time < " . $params['begin_time'])
->fetchSql(true)
->count();
$items = $model->field("count(distinct game_id,create_device_number) count, FROM_UNIXTIME(create_time, '%Y-%m-%d') as day,
(" . $sql . ") as num")
$subQuery = $model->field('FROM_UNIXTIME(create_time, "%Y-%m-%d") as day,count(DISTINCT create_device_number) as count')
->where($conditions)
->group("day")
->group('game_id')
->buildSql();
$items = M()->field("*,sum(count) as count,(" . $sql . ") as num")
->table($subQuery)
->alias('a')
->group('day')
->having('num = 0')
->select();
return $this->assembleRecords($items, $dayList, 'count');
@ -476,10 +494,14 @@ class UserRepository
->where("ti.create_ip = create_ip and ti.game_id = game_id and ti.create_time < " . $params['begin_time'])
->fetchSql(true)
->count();
$items = $model->field("count(distinct game_id,create_ip) count, FROM_UNIXTIME(create_time, '%Y-%m-%d') as day,
(" . $sql . ") as num")
$subQuery = $model->field('FROM_UNIXTIME(create_time, "%Y-%m-%d") as day,count(DISTINCT create_ip) as count')
->where($conditions)
->group("day")
->group('game_id')
->buildSql();
$items = M()->field("*,sum(count) as count,(" . $sql . ") as num")
->table($subQuery)
->alias('a')
->group('day')
->having('num = 0')
->select();
return $this->assembleRecords($items, $dayList, 'count');

@ -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'];

@ -1053,7 +1053,7 @@ function is_check_account($account){
$map[$field]=$game_id;
$data=M('game','tab_')->where($map)->find();
if(empty($data)){return '';}
return $data['dratio'];
return $data['ratio'];
}
/**

@ -82,6 +82,9 @@ class ArticleController extends HomeController {
$field = 'id as document_id,category_id';
$decumentData = M('document')->field($field)->where("id={$id}")->find();
$promote_id = get_pid();
if(empty($promote_id)) {
$promote_id = 0;
}
foreach ($decumentData as $key => $value) {
$decumentData['promote_id'] = $promote_id;
$decumentData['create_time'] = time();

@ -1241,6 +1241,17 @@ class DownloadController extends BaseController {
$promoteId = I('promote_id', 0);
$sdkVersion = I('sdk_version', 0);
$headmanPromoteId = I('headman_promote_id', 0);
$costBegin = I('cost_begin', ''); //充值总额范围
$costEnd = I('cost_end', '');
$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;
$map1['chain'] = ['like','%'.'/'.PID.'/'.'%'];
$rs = M('promote','tab_')->where($map1)->field('id,account,nickname')->select();
$childPromoteIds = '';
@ -1270,7 +1281,7 @@ class DownloadController extends BaseController {
if(empty($levelPromote)) {
array_push($ids,PID);
}
array_push($ids,$queryPromote['id']);
// array_push($ids,$queryPromote['id']);
if (!empty($ids)) {
$map['promote_id'] = ['in',$ids];
@ -1304,6 +1315,18 @@ class DownloadController extends BaseController {
}
}
if($costBegin) {
$map['costbegin'] = $costBegin;
}else {
$map['costbegin'] = "";
}
if($costEnd) {
$map['costend'] = $costEnd;
}else {
$map['costend'] = "";
}
$map['begintime'] = $begTime;
$map['endtime'] = $endTime;
$conditions = json_encode($map,TRUE);
$addtime = time();
$data = [
@ -1462,7 +1485,7 @@ class DownloadController extends BaseController {
array_push($ids,PID);
}
array_push($ids,$queryPromote['id']);
//array_push($ids,$queryPromote['id']);
if (!empty($ids)) {
$map['promote_id'] = ['in',$ids];
@ -1507,7 +1530,7 @@ class DownloadController extends BaseController {
if (($playTimeEnd - $playTimeBegin) > 31 * 24 * 3600) {
$this->error('时间范围不能超过31天');
}
$map['play_time'] = ['between', [$playTimeBegin, $playTimeEnd]];
$map['create_time'] = ['between', [$playTimeBegin, $playTimeEnd]];
}
if ($isSelf) {
$map['promote_id'] = $queryPromote['id'];
@ -1735,18 +1758,21 @@ class DownloadController extends BaseController {
$xlsName = "注册明细";
$xlsCell = array(
array('account','玩家账号'),
array('promote_account','推广账号'),
array('promote_account','推广账号'),
array('device_number','设备IMIE/IDFA'),
array('register_time','注册时间'),
array('register_ip','注册ip'),
array('login_time','登陆时间'),
array('login_ip','登陆ip')
array('login_time','登陆时间'),
array('login_ip','登陆ip')
);
$model = M('user','tab_');
$data = $model->field('account,promote_account,register_time,register_ip,login_time,login_ip')->where($map)->select();
$data = $model->field('account,device_number,promote_account,register_time,register_ip,login_time,login_ip')->where($map)->order('tab_user.id desc')->select();
//var_dump($data);
$xlsData = [];
foreach ($data as $key1 => $value1) {
$value1['register_time'] = date("Y-m-d H:i:s",$value1['register_time']);
$value1['login_time'] = date("Y-m-d H:i:s",$value1['login_time']);
$value1['account'] = $this->encryption($value1['account']);
$xlsData[] = $value1;
}
@ -1761,14 +1787,16 @@ class DownloadController extends BaseController {
array('promote_account','推广账号'),
array('game_name','游戏名称'),
array('server_name','区服'),
array('user_nickname','游戏昵称'),
array('role_name','游戏昵称'),
array('role_level','等级'),
array('create_time','创建时间'),
);
$model = M('user_play_info','tab_');
$data = $model->field('user_account,promote_account,game_name,server_name,user_nickname,role_level')->where($map)->select();
$data = $model->field('user_account,promote_account,game_name,server_name,role_name,role_level')->where($map)->order('create_time desc')->select();
$xlsData = [];
foreach ($data as $key1 => $value1) {
$value1['user_account'] = $this->encryption($value1['user_account']);
$value1['create_time'] = date('Y-m-d H:i:s',$value1['create_time']);
$xlsData[] = $value1;
}
$this->exportExcel($xlsName, $xlsCell, $xlsData,$id);
@ -2701,55 +2729,92 @@ class DownloadController extends BaseController {
array('play_time','最后登录时间'),
array('promote_account','推广员账号'),
);
if(!empty($map['promote_id'])) {
$spendMap['promote_id'] = $map['promote_id'];
}
$map['create_time'] = ['between', [strtotime(date('Y-m-d 00:00:00')) - 6*24*3600, strtotime(date('Y-m-d 23:59:59'))]];
$roles = M('user_play_info','tab_')->where($map)->select();
$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(!empty($map['game_id'])) {
$subMap['game_id'] = $map['game_id'];
}
if(!empty($map['server_id'])) {
$subMap['server_id'] = $map['server_id'];
}
$costBegin = $map['costbegin'];
$costEnd = $map['costend'];
unset($map['costbegin']);
unset($map['costend']);
$subMap['create_time'] = ['between', [$map['begintime'], $map['endtime'] - 1]];
$roleIdMap = $subMap;
$roleIds = M('user_play_data_count', 'tab_')->where($roleIdMap)->group('role_id')->getField('role_id', true);
$map['role_id'] = ['in', $roleIds];
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', [$map['begintime'], $map['endtime'] - 1]];
$spendMap['_string'] = 'uc.game_id = tab_user_play_info.game_id and uc.server_id = tab_user_play_info.server_id and uc.role_id = tab_user_play_info.role_id';
// $map['create_time'] = ['between', [strtotime(date('Y-m-d 00:00:00')) - 6*24*3600, strtotime(date('Y-m-d 23:59:59'))]];
$sqlCost = M('user_play_data_count', 'tab_')->alias('uc')
->field('sum(uc.recharge_cost) cost')
->where($spendMap)
->buildSql();
$map['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($map)->group('game_player_id')->select();
$todayRecords = [];
foreach ($todayRecharges as $recharge) {
$todayRecords[$recharge['game_player_id']] = $recharge;
}
$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();
unset($map['begintime']);
unset($map['endtime']);
$subQuery = M('user_play_info', 'tab_')
->field("*,$sqlCost as recharge_cost,$sqlCount as recharge_count,$sqlTodayCost as recharge_cost_today")
->where($map)
->having('recharge_cost > 0')
->order('play_time desc')
->buildSql();
$roles = M()->field(' * ')
->table($subQuery)
->alias('a')
->order('play_time desc')
->select();
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' => empty($role['recharge_cost']) ? 0 : $role['recharge_cost'],
'recharge_count' => empty($role['recharge_count']) ? 0 : $role['recharge_count'],
'recharge_cost_today' => empty($role['recharge_cost_today']) ? 0 : $role['recharge_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))
];
}
$records = [];
foreach ($roles as $role) {
$records[] = [
'user_account' => $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))
];
}
$xlsData = [];
foreach ($records as $key1 => $value1) {
$value1['user_account'] = $this->encryption($value1['user_account']);

@ -565,4 +565,45 @@ class FinanceController extends BaseController
$this->assign('modelList', $modelList);
$this->display();
}
//审核拒绝 重新审核
public function renewReview()
{
//是否是会长
$this->purview();
//验证安全密码
$metaTitle = '结算明细';
$modelList = ['财务管理', $metaTitle];
$res = $this->verifyPasswordView($modelList, false);
if ($res == false) {
$data['status'] = 0;
$data['msg'] = '权限异常';
$this->ajaxReturn($data);
}
$id = intval(I('id', 0));
$data = M('withdraw', 'tab_')->find($id);
if (empty($data) || $data['status'] != -1) {
$data['status'] = 0;
$data['msg'] = '数据异常';
$this->ajaxReturn($data);
}
if ($data['promote_id'] != $this->loginPromote['id']) {
$data['status'] = 0;
$data['msg'] = '权限异常';
$this->ajaxReturn($data);
}
$save['status'] = 0;
$save['id'] = $id;
$res = M('withdraw', 'tab_')->save($save);
if ($res === false) {
$data['status'] = 0;
$data['msg'] = '提交失败';
} else {
$data['status'] = 1;
$data['msg'] = '提交成功';
}
$this->ajaxReturn($data);
}
}

@ -180,14 +180,14 @@ class PromoteController extends BaseController
$month_add_user_money = $this->pay_total(3, 1, $promoteId);
$yesterday_start = mktime(0, 0, 0, date('m'), date('d') - 1, date('Y'));
$yesterday_end = mktime(0, 0, 0, date('m'), date('d'), date('Y'));
$yesterday_end = mktime(0, 0, 0, date('m'), date('d'), date('Y'))-1;
//计算昨天用户的统计数据,当日用户充值数据
$pay_time = " between {$yesterday_start} and {$yesterday_end}";
$createTime = ['between', array($yesterday_start, $yesterday_end - 1)];
$yesterdaySpendData = $this->caculateSpend($pay_time, [], $createTime);
// $yesterdaySpendData = $this->caculateSpend($pay_time, []);
// var_dump($yesterdaySpendData);die();
$todayAddSpendData = $this->caculateSpend($pay_time, [], [], 1);
// var_dump($todayAddSpendData);die();
$mounthAddSpendData = $this->caculateSpend($pay_time, [], [], 2);
@ -209,7 +209,7 @@ class PromoteController extends BaseController
$this->assign('data', $data);
// $this->assign('yesterdayData',$yesterdayData);
$this->assign('spendData', $spendData);
$this->assign('yesterdaySpendData', $yesterdaySpendData);
// $this->assign('yesterdaySpendData', $yesterdaySpendData);
$this->assign('todayAddSpendData', $todayAddSpendData);
$this->assign('mounthAddSpendData', $mounthAddSpendData);
@ -240,99 +240,131 @@ class PromoteController extends BaseController
private function caculateSpend($pay_time, $condition, $create = [], $type = 0)
{
$map1['promote_id'] = $map['promote_id'] = array('egt', 0);
$spend = M('Spend', 'tab_');
$map1['pay_status'] = $map['pay_status'] = 1;
$today = total(1);
$yesterday = total(5);
$week = total(2);
$mounth = total(3);
$yesterday = total(5);
unset( $map['create_time']);
$map1['promote_id'] = $map['promote_id'] = array('gt', 0);
$map1['pay_status'] = $map['pay_status'] = 1;
$map1['pay_way'] = $map['pay_way'] = array('gt', 0);
$userId = [];
$this->getLoginPromote();
$promote_id = get_pid();
$promoteId = M("promote", "tab_")
->where(array('chain' => ['like', $this->loginPromote['chain'] . $this->loginPromote['id'] . '/%']))
->getField('id', true);
$promoteId[] = $this->loginPromote['id'];
->field("id")
->where(array('chain' => ['like', '/'.$promote_id . '/%'],'id'=>$promote_id,'_logic'=>'or'))
->select();
$promoteId = implode(',',array_column($promoteId,'id'));
$whereUser['promote_id'] = ['IN', $promoteId];
if ($type == 1) {
$pay_time = total(1);
$start = mktime(0, 0, 0, date('m'), date('d'), date('Y'));
$end = mktime(0, 0, 0, date('m'), date('d') + 1, date('Y')) - 1;
$whereUser['register_time'] = ['between', array($start, $end - 1)];
$userId = M('user', 'tab_')->field('id')->where($whereUser)->select();
} else if ($type == 2) {
$pay_time = total(3);
$start = mktime(0, 0, 0, date('m'), 1, date('Y'));
$end = mktime(0, 0, 0, date('m') + 1, 1, date('Y')) - 1;
$whereUser['register_time'] = ['between', array($start, $end - 1)];
$userId = M('user', 'tab_')->field('id')->where($whereUser)->select();
}
// if ($userId) {
// var_dump($userId);
// }
$userId = implode(',', array_column($userId, 'id'));
if ($userId) {
$userId = implode(',', array_column($userId, 'id'));
// var_dump($userId);
$map1['user_id'] = $map['user_id'] = ['IN', $userId];
} else if (!$userId && $type != 0) {
return array('today' => 0, 'mounth' => 0);
}
if ($create) {
$map['create_time'] = $create;
}
$bindrecharge_data = M('bind_recharge', 'tab_')
->field('max(id) as id,promote_account,promote_id,create_time as ordertime,date_format(FROM_UNIXTIME(create_time),"%Y-%m-%d") AS time,
floor(sum(IF(create_time ' . $pay_time . ',real_amount,0))*100) as scount,
floor(sum(IF(create_time ' . $today . ',real_amount,0))*100) as today,
floor(sum(IF(create_time ' . $week . ',real_amount,0))*100) as week,
floor(sum(IF(create_time ' . $mounth . ',real_amount,0))*100) as mounth')
->where($map1)
->group('promote_id')
->select(false);
$deposit_data = M('deposit', 'tab_')
->field('max(id) as id,promote_account,promote_id,create_time as ordertime,date_format(FROM_UNIXTIME(create_time),"%Y-%m-%d") AS time,
floor(sum(IF(create_time ' . $pay_time . ',pay_amount,0))*100) as scount,
floor(sum(IF(create_time ' . $today . ',pay_amount,0))*100) as today,
floor(sum(IF(create_time ' . $week . ',pay_amount,0))*100) as week,
floor(sum(IF(create_time ' . $mounth . ',pay_amount,0))*100) as mounth')
->where($map1)
->group('promote_id')
->select(false);
$spendData = $spend
->field('max(id) as id,promote_account,promote_id,pay_time as ordertime,date_format(FROM_UNIXTIME(pay_time),"%Y-%m-%d") AS time,
floor(sum(IF(pay_time ' . $pay_time . ',pay_amount,0))*100) as scount,
floor(sum(IF(pay_time ' . $today . ',pay_amount,0))*100) as today,
floor(sum(IF(pay_time ' . $week . ',pay_amount,0))*100) as week,
floor(sum(IF(pay_time ' . $mounth . ',pay_amount,0))*100) as mounth')
->where($map)
->union(' (' . $bindrecharge_data . ') ')
->union(' (' . $deposit_data . ') ')
->group('promote_id')
->select(false);
return array('sum_mounth' => 0, 'sum_today' => 0);
}
$promote_id = get_pid();
$promote_map = "tp1.`id` = {$promote_id}";
//获取所有会长
$promote_map = "`chain` = '%/{$promote_id}/%' OR id = {$promote_id}";
$data = $spend->field('sum(a.scount) AS count,sum(a.today) AS today,sum(a. WEEK) AS WEEK,sum(a.mounth) AS mounth')
->join("INNER JOIN (SELECT tp2.*, tp1.id AS pid, tp1.account as promote_account FROM tab_promote tp1 LEFT JOIN tab_promote tp2 ON tp2.`chain` LIKE CONCAT('%/', tp1.id, '/%') OR tp1.id = tp2.id where $promote_map ) AS t ON promote_id = t.id")
->where($condition)->table('(' . $spendData . ') as a')->group()->order('count desc,a.ordertime')->find();
$promote = M("promote","tab_")->field("id,account")->where($promote_map)->select();
$data =array();
for ($i=0; $i < count($promote); $i++) {
# code...
$proid = M("promote","tab_")->field("id")->where("`chain` like '%/{$promote[$i]['id']}/%'")->select();
$str = '';
for($k=0; $k<count($proid); $k++){
# code...
$str .= ($proid[$k]['id'].",");
}
$str .= "{$promote[$i]['id']}";
$map['promote_id'] = array("in",$str);
if (isset($_REQUEST['game_name'])) {
$map['game_name'] = $_REQUEST['game_name'];
if (isset($_REQUEST['server_id'])) {
$map['server_name'] = $_REQUEST['server_id'];
unset($_REQUEST['server_id']);
}
$dbdata = $spend
->field('
floor(sum(IF(pay_time ' . $pay_time . ',pay_amount,0))*100) as count,
floor(sum(IF(pay_time ' . $today . ',pay_amount,0))*100) as today,
floor(sum(IF(pay_time ' . $yesterday . ',pay_amount,0))*100) as yesterday,
floor(sum(IF(pay_time ' . $week . ',pay_amount,0))*100) as week,
floor(sum(IF(pay_time ' . $mounth . ',pay_amount,0))*100) as mounth')
->where($map)
->where("pay_time".$pay_time)
->find();
$dbdata['promote_account'] = $promote[$i]['account'];
} else {
$dbdata = $spend
->field('
floor(sum(IF(pay_time ' . $pay_time . ',pay_amount,0))*100) as count,
floor(sum(IF(pay_time ' . $today . ',pay_amount,0))*100) as today,
floor(sum(IF(pay_time ' . $yesterday . ',pay_amount,0))*100) as yesterday,
floor(sum(IF(pay_time ' . $week . ',pay_amount,0))*100) as week,
floor(sum(IF(pay_time ' . $mounth . ',pay_amount,0))*100) as mounth')
->where($map)
->where("pay_time".$pay_time)
->find();
$dbdata['promote_account'] = $promote[$i]['account'];
}
$data[] = $dbdata;
}
// if ($userId) {
// echo $spend->_sql();die();
// }
foreach ($data as $key => $value) {
$value['count'] ?: 0;
$value['today'] ?: 0;
$value['week'] ?: 0;
$value['mounth'] ?: 0;
static $i = 0;
$i++;
$data[$key]['rand'] = $i;
$data[$key]['count'] = $value['count'] / 100;
$data[$key]['today'] = $value['today'] / 100;
$data[$key]['yesterday'] = $value['yesterday'] / 100;
$data[$key]['week'] = $value['week'] / 100;
$data[$key]['mounth'] = $value['mounth'] / 100;
}
$total = $this->data_total($data);
$spendData1 = $spend->field('sum(a.scount) AS count,sum(a.today) AS today,sum(a. WEEK) AS WEEK,sum(a.mounth) AS mounth')
// ->join("INNER JOIN (SELECT tp2.*, tp1.id AS pid, tp1.account as promote_account FROM tab_promote tp1 LEFT JOIN tab_promote tp2 ON tp2.`chain` LIKE CONCAT('%/', tp1.id, '/%') ) AS t ON promote_id = t.id")
->where($condition)->table('(' . $spendData . ') as a')->group()->order('count desc,a.ordertime')->find();
return $total;
//
$data['rand'] = 1;
$data['count'] = $data['count'] / 100;
$data['today'] = $spendData1['today'] / 100;
$data['week'] = $spendData1['week'] / 100;
$data['mounth'] = $spendData1['mounth'] / 100;
}
return $data;
public function data_total($data)
{
$total['sum_count'] = array_sum(array_column($data, 'count'));
$total['sum_today'] = array_sum(array_column($data, 'today'));
$total['yesterday'] = array_sum(array_column($data, 'yesterday'));
$total['sum_week'] = array_sum(array_column($data, 'week'));
$total['sum_mounth'] = array_sum(array_column($data, 'mounth'));
return $total;
}
private function pay_total($type = 0, $newadd = 1, $promoteId = "")
@ -867,6 +899,7 @@ class PromoteController extends BaseController
$realName = I('real_name', '');
$status = I('status', 'all');
$promoteType = I('promote_type', 0);
$parentId = I('parent_id', 0);
$loginer = $this->getLoginPromote();
$map = [];
@ -892,6 +925,9 @@ class PromoteController extends BaseController
if ($realName) {
$map['real_name'] = ['like', '%' . $realName . '%'];
}
if ($parentId) {
$map['parent_id'] = $parentId;
}
if ($status != 'all') {
$map['status'] = ['eq', $status];
}
@ -899,10 +935,8 @@ class PromoteController extends BaseController
list($records, $pagination, $count) = $this->paginate($query);
foreach ($records as $key => $value) {
$records[$key]['idcard'] = encryption($value['idcard']);
$records[$key]['mobile_phone'] = encryption($value['mobile_phone']);
}
$ids = array_column($records, 'id');
@ -941,6 +975,23 @@ class PromoteController extends BaseController
$promoteTypeName = '推广员';
}
$parentMap = [];
$parentMap['chain'] = ['like', $loginer['chain'] . $loginer['id'] . '/%'];
$isGetParents = true;
if ($loginer['level'] == 1 && $promoteType == 1) {
$parentMap['level'] = 2;
} elseif ($loginer['level'] == 1 && $promoteType == 2) {
$parentMap['level'] = 3;
} elseif ($loginer['level'] == 2 && $promoteType == 2) {
$parentMap['level'] = 3;
} else {
$isGetParents = false;
}
$parents = null;
if ($isGetParents) {
$parents = M('promote', 'tab_')->field(['id', 'account', 'real_name'])->where($parentMap)->select();
}
$this->assign('parents', $parents);
$this->assign('promoteTypeName', $promoteTypeName);
$this->assign('hasChildList', $hasChildList);
$this->assign('hasPlayerList', $hasPlayerList);
@ -1132,15 +1183,15 @@ class PromoteController extends BaseController
$this->error('您输入的手机号码格式不合法', U('Promote/edit_chlid', array('id' => $id, 'type' => I('type', 0))));
}
if (empty($_REQUEST['email'])) {
$this->error('电子邮箱不能为空', U('Promote/edit_chlid', array('id' => $id, 'type' => I('type', 0))));
return false;
}
// if (empty($_REQUEST['email'])) {
// $this->error('电子邮箱不能为空', U('Promote/edit_chlid', array('id' => $id, 'type' => I('type', 0))));
// return false;
// }
$pattern = "/^([0-9A-Za-z\\-_\\.]+)@([0-9a-z]+\\.[a-z]{2,3}(\\.[a-z]{2})?)$/i";
if (!preg_match($pattern, $_REQUEST['email'])) {
$this->error('您输入的电子邮箱地址不合法', U('Promote/edit_chlid', array('id' => $id, 'type' => I('type', 0))));
};
// $pattern = "/^([0-9A-Za-z\\-_\\.]+)@([0-9a-z]+\\.[a-z]{2,3}(\\.[a-z]{2})?)$/i";
// if (!preg_match($pattern, $_REQUEST['email'])) {
// $this->error('您输入的电子邮箱地址不合法', U('Promote/edit_chlid', array('id' => $id, 'type' => I('type', 0))));
// };
$user = new PromoteApi();
$res = $user->edit($_POST);

@ -1709,118 +1709,169 @@ 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', '');
$lastSortName = trim(I('last_sort_name', ''));
$sortName = trim(I('sort_name', ''));
$sort = intval(I('sort', 1));
$sortNameData = ['recharge_cost', 'recharge_count', 'recharge_cost_today', 'unlogin_day'];
$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);
$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);
$map = [];
if (count($ids) > 0) {
$map = ['promote_id' => ['in', $ids]];
} else {
$map['_string'] = '1<>1';
}
$map = [];
if (count($ids) > 0) {
$map = ['promote_id' => ['in', $ids]];
} else {
$map['_string'] = '1<>1';
}
$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;
$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'];
}
$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;
}
$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]];
$roleIdMap = $subMap;
$roleIds = M('user_play_data_count', 'tab_')->where($roleIdMap)->group('role_id')->getField('role_id', true);
$map['role_id'] = ['in', $roleIds];
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 . ')';
}
$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))
];
$orderBy = 'play_time desc';
if (!empty($sortName)) {
if (in_array($sortName, $sortNameData)) {
$desc = ' desc';
$asc = ' asc';
if ($sortName == 'unlogin_day') {
$sortName = 'play_time';
$desc = ' asc';
$asc = ' desc';
}
if ($lastSortName == 'unlogin_day') {
$lastSortName = 'play_time';
}
if ($lastSortName != $sortName) {
$sortString = $desc;
$sort = 1;
} else {
$sortString = ($sort == 1) ? $desc : $asc;
}
$orderBy = $sortName . $sortString;
}
}
$spendMap['uc.create_time'] = ['between', [$begTime, $endTime - 1]];
$spendMap['_string'] = 'uc.game_id = tab_user_play_info.game_id and uc.server_id = tab_user_play_info.server_id and uc.role_id = tab_user_play_info.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();
$subQuery = M('user_play_info', 'tab_')
->field("*,$sqlCost as recharge_cost,$sqlCount as recharge_count,$sqlTodayCost as recharge_cost_today")
->where($map)
->having('recharge_cost > 0')
->order('play_time desc')
->buildSql();
$query = M()->field('*')
->table($subQuery)
->alias('a')
->order($orderBy);
list($roles, $pagination, $count) = $this->paginate($query);
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' => empty($role['recharge_cost']) ? 0 : $role['recharge_cost'],
'recharge_count' => empty($role['recharge_count']) ? 0 : $role['recharge_count'],
'recharge_cost_today' => empty($role['recharge_cost_today']) ? 0 : $role['recharge_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->assign('sort', $sort);
$this->display('userRecharges');
}
@ -1906,10 +1957,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 +2051,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 +2064,6 @@ 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'],
@ -2027,7 +2077,7 @@ class QueryController extends BaseController
'login_user_count' => $selfLoginUserCountList[$parent['id']],
'recharge_count' => $selfRechargeCountList[$parent['id']],
'recharge_user_count' => $selfRechargeUserCountList[$parent['id']],
'recharge_amount' => $selfRechargeAmountList[$parent['id']]['ban_coin'] + $rechargeAmountList[$parent['id']]['coin'] + $rechargeAmountList[$parent['id']]['cash'],
'recharge_amount' => $selfRechargeAmountList[$parent['id']]['ban_coin'] + $selfRechargeAmountList[$parent['id']]['coin'] + $selfRechargeAmountList[$parent['id']]['cash'],
'recharge_by_ban_coin' => $selfRechargeAmountList[$parent['id']]['ban_coin'],
'recharge_by_coin' => $selfRechargeAmountList[$parent['id']]['coin'],
'recharge_by_cash' => $selfRechargeAmountList[$parent['id']]['cash'],
@ -2070,13 +2120,13 @@ 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();
}
public function getChildPromoteList()
{
$promoteId = intval(I('post.promote_id', 0));
$promoteId = intval(I('post . promote_id', 0));
$promoteId = empty($promoteId) ? PID : $promoteId;
$promoteList = getAllPromoteListByType(3, false, $promoteId);
$data['status'] = 1;

@ -443,38 +443,13 @@ class SafeController extends BaseController{
public function safeDocument() {
$time = time();
$today = date('Y-m-d');
$username = $_REQUEST['username'];
$tsession =S($today);
if(S($username)) {
$code = S($username);
}else {
if(!empty($tsession)) {
$num = $tsession + 1;
}else {
$num = 1;
}
$promoteRs = M('promote','tab_')->where(['account'=>$username])->getField('create_time',true);
$code = date('Ymd',$promoteRs[0])."_".$num;
}
$loginPromote = $this->getLoginPromote();
$sn = date('Ymd') . '-' . strtoupper(substr(md5($loginPromote['id']), 8, 16));
$endTime = date('Y-m-d',strtotime('+1 year'));
$this->assign('time',date('Y-m-d',$time));
$this->assign('endTime',$endTime);
$this->assign('code',$code);
$this->assign('username',$username);
$this->assign('sn',$sn);
$this->display();
}
public function ajaxAgree() {
$username = $_REQUEST['username'];
$code = $_REQUEST['code'];
$today = date('Y-m-d');
if(empty(S($username))) {
S($username, $code);
$t = S($today);
S($today,$t+1);
}
$this->ajaxReturn(['code'=>10000]);
}
}

@ -173,6 +173,8 @@
<a href="{:U('withdrawDtl', array('id'=>$vo['id']))}">提现明细</a>
<if condition="$vo['status'] eq 2">
<a data-href="{:U('download/Remittancecer',['id'=>$vo['id']])}" class="ajax-get">汇款证明</a>
<elseif condition="$vo['status'] eq -1"/>
<span class="renew-review" data-id="{$vo['id']}" style="color: #0bb20c;cursor: pointer;">重新审核</span>
</if>
<a href="{:U('settlementOrder', array('id'=>$vo['id']))}">结算单</a>
</td>
@ -267,6 +269,30 @@
});
$(".select_gallery").select2();
$('.renew-review').click(function () {
var id = parseInt($(this).attr('data-id'));
$.ajax({
type: 'post',
url: '{:U("renewReview")}',
dataType: 'json',
data: {id:id},
success: function (data) {
if (data.status == 1) {
layer.msg(data.msg, {icon: 1});
setTimeout(function(){
window.location.reload();
},2000);
} else {
layer.msg(data.msg, {icon: 5});
}
},
error: function (result) {
layer.msg('网络异常', {icon: 5});
}
});
});
});
</script>

@ -31,6 +31,16 @@
<option value="2" <if condition="I('status') === '2'">selected</if>>冻结中</option>
</select>
</div>
<?php if($parents):?>
<div class="form-group fr normal_space">
<select name="parent_id" class="reselect select_gallery" style="width: 220px;" >
<option value="0">请选择上级</option>
<?php foreach($parents as $parent):?>
<option value="<?=$parent['id']?>" <?php if(I('parent_id')==$parent['id']):?>selected<?php endif;?>><?=$parent['account']?>(<?=$parent['real_name']?>)</option>
<?php endforeach;?>
</select>
</div>
<?php endif;?>
<div class="form-group fr normal_space">
<input type="text" name="real_name" class="txt normal_txt" id="uid" placeholder="请输入姓名" value="{:I('real_name')}">
</div>

@ -97,7 +97,7 @@
<tr>
<td class="l"><i style="margin-right:4px;color:red">*</i>电子邮箱</td>
<td class="l">电子邮箱</td>
<td class="r">

@ -6,15 +6,15 @@
<div class="page-overview promote-index-overview index-overview clearfix poll">
<ul>
<li><div class="icon"><span class="placeholder-graphic"><img src="__IMG__/20180207/icon_chongzhi1.png"/></span></div> <div class="text text2"><p>推广总用户</p><span>{$data.count}</span></div> </li>
<li><div class="icon"><span class="placeholder-graphic"><img src="__IMG__/20180207/icon_chongzhi2.png"/></span></div> <div class="text text1"><p>推广总充值</p><span>¥{$spendData.count}</span></div> </li>
<li><div class="icon"><span class="placeholder-graphic"><img src="__IMG__/20180207/icon_chongzhi3.png"/></span></div> <div class="text text3"><p>当日新增用户充值</p><span>¥{$todayAddSpendData.today}</span></div> </li>
<li><div class="icon"><span class="placeholder-graphic"><img src="__IMG__/20180207/icon_chongzhi5.png"/></span></div> <div class="text text5"><p>当月新增用户充值</p><span>¥{$mounthAddSpendData.mounth}</span></div> </li>
<li><div class="icon"><span class="placeholder-graphic"><img src="__IMG__/20180207/icon_chongzhi2.png"/></span></div> <div class="text text1"><p>推广总充值</p><span>¥{$spendData.sum_count}</span></div> </li>
<li><div class="icon"><span class="placeholder-graphic"><img src="__IMG__/20180207/icon_chongzhi3.png"/></span></div> <div class="text text3"><p>当日新增用户充值</p><span>¥{$todayAddSpendData.sum_today}</span></div> </li>
<li><div class="icon"><span class="placeholder-graphic"><img src="__IMG__/20180207/icon_chongzhi5.png"/></span></div> <div class="text text5"><p>当月新增用户充值</p><span>¥{$mounthAddSpendData.sum_mounth}</span></div> </li>
</ul>
<ul style="margin-top: 10px">
<li><div class="icon"><span class="placeholder-graphic"><img src="__IMG__/20180207/icon_chongzhi1.png"/></span></div> <div class="text text2"><p>昨日注册用户</p><span>{$data.yesterday}</span></div> </li>
<li><div class="icon"><span class="placeholder-graphic"><img src="__IMG__/20180207/icon_chongzhi2.png"/></span></div> <div class="text text1"><p>昨日充值金额</p><span>¥{$yesterdaySpendData.count}</span></div> </li>
<li><div class="icon"><span class="placeholder-graphic"><img src="__IMG__/20180207/icon_chongzhi2.png"/></span></div> <div class="text text1"><p>昨日充值金额</p><span>¥{$spendData.yesterday}</span></div> </li>
<li><div class="icon"><span class="placeholder-graphic"><img src="__IMG__/20180207/icon_chongzhi3.png"/></span></div> <div class="text text3"><p>今日注册用户</p><span>{$data.today}</span></div> </li>
<li><div class="icon"><span class="placeholder-graphic"><img src="__IMG__/20180207/icon_chongzhi5.png"/></span></div> <div class="text text5"><p>今日充值金额</p><span>¥{$spendData.today}</span></div> </li>
<li><div class="icon"><span class="placeholder-graphic"><img src="__IMG__/20180207/icon_chongzhi5.png"/></span></div> <div class="text text5"><p>今日充值金额</p><span>¥{$spendData.sum_today}</span></div> </li>
</ul>
</div>
<div class="index-tab-list">

@ -109,8 +109,8 @@
<!-- <td>{$record.new_create_role_device_count}</td> -->
<td>{$record.new_create_role_ip_count}</td>
<td>{$record.login_user_count}</td>
<td>{$record.recharge_count}</td>
<td>{$record.recharge_user_count}</td>
<td>{$record.recharge_count}</td>
<td>{$record.recharge_amount}</td>
<td>{$record.recharge_by_cash}</td>
<td>{$record.recharge_by_coin}</td>

@ -72,8 +72,7 @@
</div>
<div class="form-group normal_space">
<input type="submit" class="submit" id='submit' url="{:U('Query/register','model='.$model['name'],false)}"
value="查询">
<input type="submit" class="submit" id='submit' url="{:U('Query/register','model='.$model['name'],false)}" value="查询">
</div>
<div class="form-group normal_space" style="margin-left: 46px;">

@ -1,6 +1,7 @@
<extend name="Public/promote_base"/>
<block name="css">
<link href="__CSS__/20180207/account.css" rel="stylesheet" >
<link href="__STATIC__/icons_alibaba/iconfont.css?v=1.3" rel="stylesheet">
<style>
.form-group {
float: left;
@ -9,6 +10,16 @@
.form-group label {
line-height: 34px;
height: 34px;
}
.iconsort {
font-size: 1rem;
}
.normal_table tr .sort {
color: #145ccd;
cursor: pointer;
}
.trunk-search .select-time .txt {
width: 100px;
}
</style>
</block>
@ -22,51 +33,63 @@
<span class="title_main">玩家充值</span>
</div>
<div class="trunk-content article">
<div class="trunk-search clearfix">
<form action="{:U('Query/userRecharges',array('row'=>I('get.row')))}" method="post" enctype="multipart/form-data">
<div class="form-group normal_space">
<select id="game-select" name="game_id" class="reselect select_gallery" style="width: 220px;" >
<option value="0">请选择游戏</option>
<volist name="games" id="game">
<div class="trunk-search clearfix jssearch">
<div class="form-group normal_space">
<select id="game-select" name="game_id" class="reselect select_gallery" style="width: 220px;" >
<option value="0">请选择游戏</option>
<volist name="games" id="game">
<option value="{$game.game_id}" <if condition="I('game_id') === $game['game_id']">selected</if>>{$game.game_name}</option>
</volist>
</select>
</div>
<div class="form-group normal_space">
<select id="server-select" name="server_id" class="reselect select_gallery" style="width: 220px;" data-server="{:I('server_id', 0)}">
<option value="0">请选择区服</option>
</select>
</div>
<div class="form-group normal_space">
<select name="sdk_version" class="reselect select_gallery" style="width: 220px;" >
<option value="0">请选择设备类型</option>
<option value="1" <if condition="I('sdk_version') === '1'">selected</if>>Andriod</option>
<option value="2" <if condition="I('sdk_version') === '2'">selected</if>>IOS</option>
</select>
</div>
<include file="Public/promote_select" />
<div class="form-group normal_space">
<input type="text" name="role_name" class="txt normal_txt" id="uid" placeholder="请输入角色名" value="{:I('role_name')}">
</div>
<div class="form-group normal_space">
<input type="text" name="user_account" class="txt normal_txt" id="uid" placeholder="请输入玩家账号" value="{:I('user_account')}">
</div>
<!-- <div class="form-group normal_space">
<input type="text" name="device_sn" class="txt normal_txt" id="uid" placeholder="请输入设备号" value="{:I('device_sn')}">
</div> -->
<div class="form-group normal_space fr">
<label>充值总额:</label>
<input type="text" class="txt float-input" name="cost_begin" style="width: 50px" value="{:I('cost_begin')}" >
<label> ~ </label>
<input type="text" class="txt float-input" name="cost_end" style="width: 50px" value="{:I('cost_end')}" >
</div>
<div class="form-group normal_space">
<input type="submit" class="submit" value="查询">
</volist>
</select>
</div>
<div class="form-group normal_space">
<select id="server-select" name="server_id" class="reselect select_gallery" style="width: 220px;" data-server="{:I('server_id', 0)}">
<option value="0">请选择区服</option>
</select>
</div>
<div class="form-group normal_space">
<select name="sdk_version" class="reselect select_gallery" style="width: 220px;" >
<option value="0">请选择设备类型</option>
<option value="1" <if condition="I('sdk_version') === '1'">selected</if>>Andriod</option>
<option value="2" <if condition="I('sdk_version') === '2'">selected</if>>IOS</option>
</select>
</div>
<include file="Public/promote_select" />
<div class="form-group normal_space">
<input type="text" name="role_name" class="txt normal_txt" placeholder="请输入角色名" value="{:I('role_name')}">
</div>
<div class="form-group normal_space">
<input type="text" name="user_account" class="txt normal_txt" placeholder="请输入玩家账号" value="{:I('user_account')}">
</div>
<!-- <div class="form-group normal_space">
<input type="text" name="device_sn" class="txt normal_txt" id="uid" placeholder="请输入设备号" value="{:I('device_sn')}">
</div> -->
<div class="form-group normal_space fr">
<label>充值总额:</label>
<input type="text" class="txt float-input" name="cost_begin" style="width: 50px" value="{:I('cost_begin')}" >
<label> ~ </label>
<input type="text" class="txt float-input" name="cost_end" style="width: 50px" value="{:I('cost_end')}" >
</div>
<div class="form-group normal_space fr" style="display: flex;">
<label class="form-title select-title" style="position: relative;">充值时间:</label>
<div class="select-time">
<input type="text" readonly id="sdate" class="txt" name="begtime" placeholder="开始时间" value="{$initBegTime}">
</div>
<div class="form-group normal_space">
<label><input name="is_self" value="1" <if condition="I('is_self') == 1">checked</if> type="checkbox"> 本账号推广</label>
<label class="form-title select-title zhi_color">&nbsp;&nbsp;</label>
<div class="select-time">
<input type="text" readonly id="edate" class="txt" name="endtime" placeholder="结束时间" value="{$initEndTime}">
</div>
</form>
</div>
<div class="form-group normal_space">
<input type="hidden" name="last_sort_name" id="last_sort_name" value="{:I('sort_name', '')}">
<input type="hidden" name="sort_name" id="sort_name" value="{:I('sort_name', '')}">
<input type="hidden" name="sort" id="sort" value="{$sort}">
<input type="submit" class="submit" id='submit' url="{:U('Query/userRecharges','model='.$model['name'],false)}"
value="查询">
</div>
<div class="form-group normal_space">
<label><input name="is_self" value="1" <if condition="I('is_self') == 1">checked</if> type="checkbox"> 本账号推广</label>
</div>
</div>
<div class="trunk-list list_normal">
<table class="table normal_table">
@ -77,10 +100,50 @@
<th>游戏区服</th>
<th>角色名</th>
<th>等级</th>
<th>充值总额</th>
<th>充值次数</th>
<th>今日充值</th>
<th>未登录天数</th>
<th class="sort" sort-name="recharge_cost">充值总额
<if condition="'recharge_cost' == I('sort_name', '')">
<if condition="1 == $sort">
<i class="iconfont iconsort-down"></i>
<else/>
<i class="iconfont iconsort-up"></i>
</if>
<else/>
<i class="iconfont iconsort"></i>
</if>
</th>
<th class="sort" sort-name="recharge_count">充值次数
<if condition="'recharge_count' == I('sort_name', '')">
<if condition="1 == $sort">
<i class="iconfont iconsort-down"></i>
<else/>
<i class="iconfont iconsort-up"></i>
</if>
<else/>
<i class="iconfont iconsort"></i>
</if>
</th>
<th class="sort" sort-name="recharge_cost_today">今日充值
<if condition="'recharge_cost_today' == I('sort_name', '')">
<if condition="1 == $sort">
<i class="iconfont iconsort-down"></i>
<else/>
<i class="iconfont iconsort-up"></i>
</if>
<else/>
<i class="iconfont iconsort"></i>
</if>
</th>
<th class="sort" sort-name="unlogin_day">未登录天数
<if condition="'unlogin_day' == I('sort_name', '')">
<if condition="1 == $sort">
<i class="iconfont iconsort-down"></i>
<else/>
<i class="iconfont iconsort-up"></i>
</if>
<else/>
<i class="iconfont iconsort"></i>
</if>
</th>
<th>最后登录时间</th>
<th>推广员账号</th>
</tr>
@ -109,7 +172,7 @@
</div>
<div class="pagenation clearfix">
<?php if ($loginer['level'] !== 4) :?>
<a id="sch-btn" data-href="{:U('download/userRecharge_data_export',array_merge(['xlsname'=>'ceshi'],I('post.')))}" class="ajax-get">导出</a>
<a id="sch-btn" data-href="{:U('download/userRecharge_data_export',array_merge(['xlsname'=>'ceshi'],I('get.')))}" class="ajax-get">导出</a>
<?php endif ;?>
{$pagination}
</div>
@ -124,11 +187,42 @@
</div>
</block>
<block name="script">
<link href="__STATIC__/datetimepicker/css/datetimepicker.css" rel="stylesheet" type="text/css">
<link href="__STATIC__/datetimepicker/css/dropdown.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="__STATIC__/datetimepicker/js/bootstrap-datetimepicker.min.js"></script>
<script type="text/javascript" src="__STATIC__/datetimepicker/js/locales/bootstrap-datetimepicker.zh-CN.js"
charset="UTF-8"></script>
<script type="text/javascript" src="__JS__/20170831/select2.min.js"></script>
<script type="text/javascript" src="__JS__/common.js"></script>
<script type="text/javascript">
$(function(){
$(".select_gallery").select2();
$(function(){
setValue('row', '{:I("get.row",10)}');
$(".select_gallery").select2();
var date = "{$setdate}";
$('#sdate').datetimepicker({
format: 'yyyy-mm-dd',
language: "zh-CN",
minView: 2,
autoclose: true,
scrollMonth: false,
scrollTime: false,
scrollInput: false,
endDate: date
});
$('#edate').datetimepicker({
format: 'yyyy-mm-dd',
language: "zh-CN",
minView: 2,
autoclose: true,
pickerPosition: 'bottom-left',
scrollMonth: false,
scrollTime: false,
scrollInput: false,
endDate: date
});
var gameId = $('#game-select').val();
var defaultServerId = $('#server-select').attr('data-server');
getGameServers(gameId, defaultServerId)
@ -160,7 +254,46 @@ $(function(){
}
var promoteUrl = "{:U('Query/getSubPromotes')}"
initPromoteSelect(promoteUrl)
initPromoteSelect(promoteUrl);
$('.sort').click(function () {
var element = $(this);
var sortName = element.attr('sort-name');
var sort = parseInt($('#sort').val());
sort = (sort === 1) ? 2 : 1;
$('#sort').val(sort);
$('#sort_name').val(sortName);
$('#submit').trigger('click');
});
$('#submit').click(function () {
var sdate = Date.parse($('#sdate').val()) / 1000;
var edate = Date.parse($('#edate').val()) / 1000;
if (sdate > edate) {
layer.msg('开始时间必须小于等于结束时间');
return false;
}
if ((edate - sdate) > 2592000) {
layer.msg('时间间隔不能超过31天请重新选择日期');
return false;
}
var url = $(this).attr('url');
console.log(url);
var query = $('.jssearch').find('input').serialize();
query += "&" + $('.jssearch').find('select').serialize();
query = query.replace(/(&|^)(\w*?\d*?\-*?_*?)*?=?((?=&)|(?=$))/g, '');
query = query.replace(/^&/g, '');
if (url.indexOf('?') > 0) {
url += '&' + query;
} else {
url += '?' + query;
}
window.location.href = url;
});
})
</script>
</block>

@ -22,52 +22,51 @@
<span class="title_main">角色查询</span>
</div>
<div class="trunk-content article">
<div class="trunk-search clearfix">
<form action="{:U('Query/userRoles',array('row'=>I('get.row')))}" method="post" enctype="multipart/form-data">
<div class="form-group normal_space">
<select id="game-select" name="game_id" class="reselect select_gallery" style="width: 220px;" >
<option value="0">请选择游戏</option>
<volist name="games" id="game">
<div class="trunk-search clearfix jssearch">
<div class="form-group normal_space">
<select id="game-select" name="game_id" class="reselect select_gallery" style="width: 220px;" >
<option value="0">请选择游戏</option>
<volist name="games" id="game">
<option value="{$game.game_id}" <if condition="I('game_id') eq $game['game_id']">selected</if>>{$game.game_name}</option>
</volist>
</select>
</div>
<div class="form-group normal_space">
<select id="server-select" name="server_id" class="reselect select_gallery" style="width: 220px;" data-server="{:I('server_id', 0)}">
<option value="0">请选择区服</option>
</select>
</div>
<div class="form-group normal_space">
<select name="sdk_version" class="reselect select_gallery" style="width: 220px;" >
<option value="0">请选择设备类型</option>
<option value="1" <if condition="I('sdk_version') === '1'">selected</if>>Andriod</option>
<option value="2" <if condition="I('sdk_version') === '2'">selected</if>>IOS</option>
</select>
</div>
<include file="Public/promote_select" />
<div class="form-group normal_space">
<input type="text" name="role_name" class="txt normal_txt" id="uid" placeholder="请输入角色名" value="{:I('role_name')}">
</div>
<div class="form-group normal_space">
<input type="text" name="user_account" class="txt normal_txt" id="uid" placeholder="请输入玩家账号" value="{:I('user_account')}">
</div>
<div class="form-group normal_space fr">
<label>创建时间:</label>
<input type="text" class="txt range-date" name="create_time" placeholder="创建时间" value="{:I('create_time')}" >
</div>
<div class="form-group normal_space fr">
<label>玩家等级:</label>
<input type="text" class="txt integer-input" name="role_level_begin" style="width: 50px" value="{:I('role_level_begin')}">
<label> ~ </label>
<input type="text" class="txt integer-input" name="role_level_end" style="width: 50px" value="{:I('role_level_end')}" >
</div>
<div class="form-group">
<input type="submit" class="submit normal_space" value="查询">
</div>
<div class="form-group normal_space">
<label><input name="is_self" value="1" type="checkbox" <if condition="I('is_self') == 1">checked</if>> 本账号推广</label>
</div>
</form>
</volist>
</select>
</div>
<div class="form-group normal_space">
<select id="server-select" name="server_id" class="reselect select_gallery" style="width: 220px;" data-server="{:I('server_id', 0)}">
<option value="0">请选择区服</option>
</select>
</div>
<div class="form-group normal_space">
<select name="sdk_version" class="reselect select_gallery" style="width: 220px;" >
<option value="0">请选择设备类型</option>
<option value="1" <if condition="I('sdk_version') === '1'">selected</if>>Andriod</option>
<option value="2" <if condition="I('sdk_version') === '2'">selected</if>>IOS</option>
</select>
</div>
<include file="Public/promote_select" />
<div class="form-group normal_space">
<input type="text" name="role_name" class="txt normal_txt" id="uid" placeholder="请输入角色名" value="{:I('role_name')}">
</div>
<div class="form-group normal_space">
<input type="text" name="user_account" class="txt normal_txt" id="uid" placeholder="请输入玩家账号" value="{:I('user_account')}">
</div>
<div class="form-group normal_space fr">
<label>创建时间:</label>
<input type="text" class="txt range-date" name="create_time" placeholder="创建时间" value="{:I('create_time')}" >
</div>
<div class="form-group normal_space fr">
<label>玩家等级:</label>
<input type="text" class="txt integer-input" name="role_level_begin" style="width: 50px" value="{:I('role_level_begin')}">
<label> ~ </label>
<input type="text" class="txt integer-input" name="role_level_end" style="width: 50px" value="{:I('role_level_end')}" >
</div>
<div class="form-group normal_space">
<input type="submit" class="submit" id='submit' url="{:U('Query/userRoles','model='.$model['name'],false)}"
value="查询">
</div>
<div class="form-group normal_space">
<label><input name="is_self" value="1" type="checkbox" <if condition="I('is_self') == 1">checked</if>> 本账号推广</label>
</div>
</div>
<div class="trunk-list list_normal">
<table class="table normal_table">
@ -108,7 +107,7 @@
</div>
<div class="pagenation clearfix">
<?php if ($loginer['level'] !== 4) :?>
<a id="sch-btn" data-href="{:U('download/userRoles_data_export',array_merge(['xlsname'=>'ceshi'],I('post.')))}" class="ajax-get">导出</a>
<a id="sch-btn" data-href="{:U('download/userRoles_data_export',array_merge(['xlsname'=>'ceshi'],I('get.')))}" class="ajax-get">导出</a>
<?php endif ;?>
{$pagination}
</div>
@ -130,6 +129,8 @@
<script type="text/javascript" src="__JS__/common.js"></script>
<script type="text/javascript">
$(function() {
setValue('row', '{:I("get.row",10)}');
var defaultDate = $('.range-date').val()
defaultDate = defaultDate == '' ? [] : defaultDate.split(' 至 ')
$('.range-date').flatpickr({
@ -171,6 +172,22 @@ $(function() {
var promoteUrl = "{:U('Query/getSubPromotes')}"
initPromoteSelect(promoteUrl)
$('#submit').click(function () {
var url = $(this).attr('url');
console.log(url);
var query = $('.jssearch').find('input').serialize();
query += "&" + $('.jssearch').find('select').serialize();
query = query.replace(/(&|^)(\w*?\d*?\-*?_*?)*?=?((?=&)|(?=$))/g, '');
query = query.replace(/^&/g, '');
if (url.indexOf('?') > 0) {
url += '&' + query;
} else {
url += '?' + query;
}
window.location.href = url;
});
})
</script>
</block>

@ -51,7 +51,7 @@ and open the template in the editor.
<div class="title"><h2>游戏推广服务框架协议</h1></div>
<div class="text">
<p>本协议由以下双方于<span>{$time}</span>签订:</p>
<p>合同编号:{$code}</p>
<p>合同编号:{$sn}</p>
<p style="font-weight: bold">甲方:海南万盟天下科技有限公司</p>
<p>注册地址海南省海口市南海大道26号海口国家高新区创业孵化中心A楼5层A1-1268室</p>
<p>联系电话13067391751</p>
@ -237,8 +237,6 @@ and open the template in the editor.
</div>
<button id="ag" style="width:120px;height:40px;background: #26C7DB;color:white;border:none" >同意</button>
<input type="hidden" id='us' value="{$username}"/>
<input type="hidden" id='code' value="{$code}"/>
<br><br><br><br>
<br><br><br><br>
</div>
@ -247,20 +245,10 @@ and open the template in the editor.
$(function() {
var username = document.getElementById('us').value;
var code = document.getElementById('code').value;
$("#ag").on('click',function(event) {
$.ajax({
type:"POST",
url:"{:U('Safe/ajaxAgree')}",
data:{'username':username,'code':code},
dataType:'json',
success:function(res) {
window.localStorage.setItem('checked','checked');
window.history.back(-1);
}
});
})
window.localStorage.setItem('checked','checked');
window.location.href = "/index.php?s=/Home/Safe/modifyBaseInfo.html"
});
})
</script>

@ -51,15 +51,23 @@ class SsgController extends BaseController {
public function home(){
if (I('user_token')) {
if (I('user_token')&&I('user_id')&&I('game_id')) {
$userToker = I('user_token');
$where['user_token'] = $userToker;
$isToken = M('user','tab_')->field('id as user_id,account,nickname')->where($where)->find();
$user_id = I('user_id');
$game_id = I('game_id');
$where['tab_user_token.user_token'] = $userToker;
$where['tab_user_token.user_id'] = $user_id;
$where['tab_user_token.game_id'] = $game_id;
$isToken = M('user_token','tab_')->field('user.id as user_id,user.account as account,user.nickname as nickname')
->join("left join tab_user as user on user.id = tab_user_token.user_id")
->where($where)
->find();
if ($isToken) {
session("user_auth",$isToken);
$this->redirect("Ssg/index");
$this->redirect("Ssg/index",array('game_id'=>$game_id));
} else {
$this->redirect("Ssg/login");
}
@ -578,10 +586,10 @@ class SsgController extends BaseController {
//$param['notifyurl'] = "https://m.wmtxkj.com/callback.php/Notify/notify/apitype/alipay";
if(stripos($_SERVER['HTTP_HOST'], '.wmtxkj.cn') || $_SERVER['HTTP_HOST']=='127.0.0.1' || stripos($_SERVER['HTTP_HOST'], '.free.idcfengye.com')){
$param['callback'] = "http://".$_SERVER['HTTP_HOST']."/mobile.php/Ssg/install_show/user_id/{$userId}/game_id/{$gameId}/order_id/{$orderId}";
$param['notifyurl'] = "http://".$_SERVER['HTTP_HOST']."/callback.php/Notify/notify/apitype/alipay";
//$param['notifyurl'] = "http://".$_SERVER['HTTP_HOST']."/callback.php/Notify/notify/apitype/alipay";
}else{
$param['callback'] = "https://".$_SERVER['HTTP_HOST']."/mobile.php/Ssg/install_show/user_id/{$userId}/game_id/{$gameId}/order_id/{$orderId}";
$param['notifyurl'] = "https://".$_SERVER['HTTP_HOST']."/callback.php/Notify/notify/apitype/alipay";
//$param['notifyurl'] = "https://".$_SERVER['HTTP_HOST']."/callback.php/Notify/notify/apitype/alipay";
}
$ali_pay = $this->alipay($param);
@ -613,7 +621,7 @@ class SsgController extends BaseController {
->setTable("supersign")
->setPayWay($param['payway'])
->setCallback($param['callback'])
->setNotifyUrl($param['notifyurl'])
//->setNotifyUrl($param['notifyurl'])
->setGameName(get_game_name($param['game_id']))
->setServerId(0)
->setUserId($param['user_id'])

@ -100,6 +100,7 @@
<div class="pay-button">
<div style="background:url('__IMG__/ssg/index/paybt.png') no-repeat top center/cover;">确认支付¥10</div>
</div>
<input id="this_game_id" value="{$_GET['game_id']}" style="display: none"/>
</body>
<script type="text/template" id="gametpl">
{@each list as item,index}
@ -114,7 +115,7 @@
至尊特权礼包(限量)
</div>
</div>
{@if index==0}
{@if item.game_id==game_id}
<div class="gamechoose gamenocheck gamecheck"></div>
{@else}
<div class="gamechoose gamenocheck "></div>
@ -149,12 +150,39 @@ var index = {
})
},
jucierFun(data){
data['game_id'] = $('#this_game_id').val();
var first,aimArr,aimNum;
first = {id:0};
aimArr = {id:0};
if(data['game_id']) {
data["list"].forEach(function (arr,index) {
if (index == 0) {
first = arr;
}
if(arr.id==data['game_id']) {
aimArr = arr;
aimNum = index;
}
})
if (aimArr.id != 0) {
if (first.id !=aimArr.id) {
data["list"][0] = aimArr;
data['list'][aimNum] = first;
}
}
}
var tpl = document.getElementById('gametpl').innerHTML;
var html = juicer(tpl, data);
$("#gamebox").html(html);
if(data["list"].length != 0){
index.choose.game_id = data['list'][0]['game_id']
}
index.event();
},
event(){

@ -11,6 +11,9 @@
<script src="/Public/Mobile/js/ssg/flexible.min.js" type="text/javascript"></script>
<link href="__CSS__/common-cz.css" rel="stylesheet" >
<style>
.pop-dialog span{font-size: .3rem}
</style>
</head>
<body class="install-box">
<div class="title" >
@ -27,8 +30,7 @@
<div class="game-rule">不同设备需要分别付费安装哦,请使用常用设备下载</div>
<div class="download-button"><a href="{$url}">下载安装</a></div>
</div>
<if condition="$giftbag">
<if condition="$giftbag['novice']">
<div style="padding:0 .3rem;">
<div class="game-gift shaddowbox">
<div class="title-3">
@ -52,7 +54,6 @@
</div>
</div>
</div>
</if>
</div>
</div>

@ -446,7 +446,8 @@ var PhoneObj = {
alert("账号必须是6-15位字母数字组合");
return false;
}
if(!PhoneObj.checkPassword(regpassword)){
if(regpassword.length < 6 || regpassword.length > 12){
alert('密码长度6-12个字符');
return false;
}
if(regpassword != regpassword2){

@ -506,3 +506,38 @@ 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`, `create_time`) 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;
--
CREATE TABLE `tab_idcard_log` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(80) NOT NULL COMMENT '姓名',
`id_card` varchar(20) NOT NULL COMMENT '身份证号码',
`user_id` int(11) NOT NULL COMMENT '用户id',
`ip` varchar(40) DEFAULT '0' COMMENT 'ip地址',
`num` int(11) DEFAULT '1' COMMENT '认证次数',
`status` tinyint(2) DEFAULT '0' COMMENT '0 认证失败 1 认证成功',
`create_time` int(11) DEFAULT '0' COMMENT '创建时间',
PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=12 DEFAULT CHARSET=utf8 COMMENT='身份证认证信息';

@ -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";
}

File diff suppressed because one or more lines are too long

@ -50,6 +50,15 @@ Created by iconfont
<glyph glyph-name="reply" unicode="&#59439;" d="M398.208 593.088V832L0 413.888l398.208-418.176V240.64c284.48 0 483.584-95.552 625.792-304.64-56.896 298.688-227.584 597.312-625.792 657.088z" horiz-adv-x="1024" />
<glyph glyph-name="sort" unicode="&#59458;" d="M64 448l448 448 448-448H64z m896-128l-448-448-448 448h896z" horiz-adv-x="1024" />
<glyph glyph-name="sort-down" unicode="&#59459;" d="M64 576l448-448 448 448z" horiz-adv-x="1024" />
<glyph glyph-name="sort-up" unicode="&#59460;" d="M960 192L512 640l-448-448z" horiz-adv-x="1024" />
<glyph glyph-name="icon-test" unicode="&#58940;" d="M192 448c0 141.152 114.848 256 256 256s256-114.848 256-256-114.848-256-256-256-256 114.848-256 256z m710.624-409.376l-206.88 206.88A318.784 318.784 0 0 1 768 448c0 176.736-143.264 320-320 320S128 624.736 128 448s143.264-320 320-320a318.784 318.784 0 0 1 202.496 72.256l206.88-206.88 45.248 45.248z" horiz-adv-x="1024" />

Before

Width:  |  Height:  |  Size: 5.9 KiB

After

Width:  |  Height:  |  Size: 6.3 KiB

Loading…
Cancel
Save