From 2e7ecfa53c93ab8f8e300eef9d9223e97c0bb81e Mon Sep 17 00:00:00 2001 From: chenxiaojun <956334972@qq.com> Date: Sun, 17 Nov 2019 15:56:37 +0800 Subject: [PATCH] =?UTF-8?q?=E7=AE=A1=E7=90=86=E5=90=8E=E5=8F=B0--=E6=9B=B4?= =?UTF-8?q?=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Application/Admin/Common/extend.php | 2 +- .../Controller/MemberController.class.php | 934 +++++++++--------- .../PromoteCoinController.class.php | 351 ++++--- .../Controller/PromoteController.class.php | 18 +- .../RechargeSumController.class.php | 308 +++--- .../Controller/SpendController.class.php | 6 +- .../Admin/Controller/access_data_foldline.txt | 2 +- .../Admin/View/BindRechargeRecord/lists.html | 2 +- Application/Admin/View/Member/user_info.html | 4 +- .../Admin/View/Promote/spend_list.html | 4 +- .../Admin/View/PromoteCoin/deduct.html | 47 +- .../Admin/View/RechargeSum/summation.html | 67 +- Application/Admin/View/Spend/lists.html | 25 +- .../Controller/PromoteController.class.php | 20 +- .../Home/Controller/QueryController.class.php | 8 - 15 files changed, 933 insertions(+), 865 deletions(-) diff --git a/Application/Admin/Common/extend.php b/Application/Admin/Common/extend.php index f558109ed..8aabb7dd1 100644 --- a/Application/Admin/Common/extend.php +++ b/Application/Admin/Common/extend.php @@ -822,7 +822,7 @@ function get_admin_id($name){ //获取所有用户列表 function get_user_list(){ $user = M('User','tab_'); - $list = $user->field('id,account,balance')->select(); + $list = $user->field('id,account,balance')->order('id')->select(); return $list; } diff --git a/Application/Admin/Controller/MemberController.class.php b/Application/Admin/Controller/MemberController.class.php index c578daf1a..cc024a314 100644 --- a/Application/Admin/Controller/MemberController.class.php +++ b/Application/Admin/Controller/MemberController.class.php @@ -14,51 +14,51 @@ class MemberController extends ThinkController public function user_info($p = 0) { $hav = ''; - if ($_REQUEST['promote_id'] != '') { - if($_REQUEST['promote_id']=='UC'){ + if ($_REQUEST['promote_id'] != '') { + if ($_REQUEST['promote_id'] == 'UC') { $maps['tab_user.promote_account'] = 'UC用户'; $hav .= "tab_user.promote_account = 'UC用户' "; - } else if ($_REQUEST['promote_id']==0) { + } else if ($_REQUEST['promote_id'] == 0) { $maps['tab_user.promote_id'] = 0; $hav .= "tab_user.promote_id = 0"; - } else{ + } else { $promoter_ids = D("Promote")->where("chain like '%/{$_REQUEST['promote_id']}/%' or id={$_REQUEST['promote_id']}")->field('id')->select(); if ($promoter_ids) { $maps['tab_user.promote_id'] = ['in', implode(',', array_column($promoter_ids, 'id'))]; - $hav .= "tab_user.promote_id in (".implode(',', array_column($promoter_ids, 'id')).") "; + $hav .= "tab_user.promote_id in (" . implode(',', array_column($promoter_ids, 'id')) . ") "; } } } - if(I('type',1) == 1){ - if(isset($_GET['register_way'])){ + if (I('type', 1) == 1) { + if (isset($_GET['register_way'])) { if ($_GET['register_way'] == 1) { empty($hav) || $hav .= ' AND '; - $hav .= ' tab_user.register_type in (1)'; + $hav .= ' tab_user.register_type in (1)'; $maps['tab_user.register_type'] = 1; - } elseif($_GET['register_way'] == 7){ + } elseif ($_GET['register_way'] == 7) { empty($hav) || $hav .= ' AND '; $hav .= ' tab_user.register_type in(7)'; $maps['tab_user.register_type'] = 7; - }else { + } else { empty($hav) || $hav .= ' AND '; $hav .= ' tab_user.register_type in(2)'; $maps['tab_user.register_type'] = 2; } - }else{ + } else { empty($hav) || $hav .= ' AND '; - $hav .= ' tab_user.register_type in (1,2,7)'; - $maps['tab_user.register_type'] = ['in',[1,2,7]]; + $hav .= ' tab_user.register_type in (1,2,7)'; + $maps['tab_user.register_type'] = ['in', [1, 2, 7]]; } - }else{ - if(isset($_GET['register_type'])){ + } else { + if (isset($_GET['register_type'])) { empty($hav) || $hav .= ' AND '; - $hav .= ' tab_user.register_type = '.$_GET['register_type']; + $hav .= ' tab_user.register_type = ' . $_GET['register_type']; $maps['tab_user.register_type'] = $_GET['register_type']; - - }else{ + + } else { empty($hav) || $hav .= ' AND '; - $hav .= ' tab_user.register_type in (0,3,4,5,6)'; - $maps['tab_user.register_type'] = ['in',[0,3,4,5,6]]; + $hav .= ' tab_user.register_type in (0,3,4,5,6)'; + $maps['tab_user.register_type'] = ['in', [0, 3, 4, 5, 6]]; } } @@ -68,11 +68,11 @@ class MemberController extends ThinkController $maps['tab_user.id'] = $_REQUEST['user_id']; unset($_REQUEST['user_id']); } - + if (isset($_REQUEST['account'])) { empty($hav) || $hav .= ' AND '; $hav .= "tab_user.account like '%" . I('account') . "%'"; - $maps['tab_user.account'] = ['like',"%".I('account')."%"]; + $maps['tab_user.account'] = ['like', "%" . I('account') . "%"]; unset($_REQUEST['account']); } if (isset($_REQUEST['device_number'])) { @@ -90,24 +90,24 @@ class MemberController extends ThinkController if (isset($_REQUEST['time_start']) && isset($_REQUEST['time_end'])) { empty($hav) || $hav .= ' AND '; $hav .= 'tab_user.register_time BETWEEN ' . strtotime(I('time_start')) . ' AND ' . (strtotime(I('time_end')) + 24 * 60 * 60 - 1); - $maps['tab_user.register_time'] = ['between',[strtotime(I('time_start')),strtotime(I('time_end'))+86399]]; + $maps['tab_user.register_time'] = ['between', [strtotime(I('time_start')), strtotime(I('time_end')) + 86399]]; unset($_REQUEST['time_start']); unset($_REQUEST['time_end']); - }elseif(isset($_REQUEST['time_start'])){ + } elseif (isset($_REQUEST['time_start'])) { empty($hav) || $hav .= ' AND '; $hav .= 'tab_user.register_time > ' . strtotime(I('time_start')); - $maps['tab_user.register_time'] = ['GT',strtotime(I('time_start'))]; + $maps['tab_user.register_time'] = ['GT', strtotime(I('time_start'))]; unset($_REQUEST['time_start']); - }elseif(isset($_REQUEST['time_end'])){ + } elseif (isset($_REQUEST['time_end'])) { empty($hav) || $hav .= ' AND '; - $hav .= 'tab_user.register_time < ' . (strtotime(I('time_end'))+86399); - $maps['tab_user.register_time'] = ['LT',strtotime(I('time_end'))+86399]; + $hav .= 'tab_user.register_time < ' . (strtotime(I('time_end')) + 86399); + $maps['tab_user.register_time'] = ['LT', strtotime(I('time_end')) + 86399]; unset($_REQUEST['time_end']); } if (isset($_REQUEST['start']) && isset($_REQUEST['end'])) { empty($hav) || $hav .= ' AND '; $hav .= 'tab_user.register_time BETWEEN ' . strtotime(I('start')) . ' AND ' . strtotime(I('end')); - $maps['tab_user.register_time'] = array('between',[strtotime(I('start')),strtotime(I('end'))]); + $maps['tab_user.register_time'] = array('between', [strtotime(I('start')), strtotime(I('end'))]); unset($_REQUEST['start']); unset($_REQUEST['end']); } @@ -115,7 +115,7 @@ class MemberController extends ThinkController $day = strtotime(date('Y-m-d')) - intval(I('line_day')) * 86400; empty($hav) || $hav .= ' AND '; $hav .= $day . '> tab_user.login_time'; - $maps['tab_user.login_time'] = ['lt',$day]; + $maps['tab_user.login_time'] = ['lt', $day]; } if (isset($_REQUEST['status'])) { $map['lock_status'] = $_REQUEST['status']; @@ -123,27 +123,28 @@ class MemberController extends ThinkController } $game_map = ""; - // if (isset($_REQUEST['game_type'])) { - // $game_map .= " and tab_user_play.sdk_version = {$_REQUEST['game_type']}"; - // } if (isset($_REQUEST['game_name'])) { - $game_map .= " and tab_user_play.game_id in (".implode(',', array_column(getGameByName($_REQUEST['game_name'], $_REQUEST['game_type']), 'id')).")"; + $game_map .= " and tab_user_play.game_id in (" . implode(',', array_column(getGameByName($_REQUEST['game_name'], $_REQUEST['game_type']), 'id')) . ")"; } $game_play_map = ''; if (isset($_REQUEST['server_name'])) { $game_play_map .= " and tab_user_play_info.server_name = '{$_REQUEST['server_name']}' "; } - + if (isset($_REQUEST['viplevel'])) { - - $havs = get_vip_level_limit('recharge_total',$_REQUEST['viplevel']); + + $havs = get_vip_level_limit('recharge_total', $_REQUEST['viplevel']); } - + $page = intval($p); $page = $page ? $page : 1; //默认显示第一页数据 - - if(isset($_REQUEST['row'])) {$row = $_REQUEST['row'];}else{$row = 10;} + + if (isset($_REQUEST['row'])) { + $row = $_REQUEST['row']; + } else { + $row = 10; + } //排序 $order = ''; @@ -161,46 +162,32 @@ class MemberController extends ThinkController } } $order .= 'a.id desc'; - - $user = M('user', 'tab_'); - $map['puid'] = array('eq',0); - $map['is_platform'] = 0; + + $user = M('user', 'tab_'); + $map['puid'] = array('eq', 0); + $map['is_platform'] = 0; //数据 - /* $data = M('user', 'tab_')->field('tab_user.id,tab_user.age_status,tab_user.account,tab_user.balance,tab_user.gold_coin,tab_user.alipay,tab_user.promote_id,tab_user.register_type,tab_user.promote_account,register_time,tab_user.lock_status,tab_user.register_way,tab_user.register_type,tab_user.register_ip,tab_user.login_time,(IFNULL(sum(b.pay_amount),0) + IFNULL(sum(ss.pay_amount),0)) AS recharge_total') + $usermodel = M('user', 'tab_'); + $sql1 = $usermodel->field('tab_user.*,IFNULL(sum(b.pay_amount),0) as deposit_total') ->join('left join tab_deposit AS b ON tab_user.id = b.user_id AND b.pay_status = 1') - ->join('left join tab_spend as ss on ss.user_id=tab_user.id AND ss.pay_status = 1') ->where($map) ->group('tab_user.id') ->where($hav) + // ->order($order) + ->select(false); + + $data = $usermodel->table('(' . $sql1 . ') as a ')->field('a.id,a.device_number,a.age_status,a.account,a.balance,a.gold_coin,a.alipay,a.promote_id,a.register_type,a.promote_account,a.register_time,a.lock_status,a.register_way,a.register_type,a.register_ip,a.login_time,(a.deposit_total+IFNULL(sum(ss.pay_amount),0)) as recharge_total,check_status') + ->join('left join tab_spend as ss on ss.user_id=a.id AND ss.pay_status = 1') + ->join($game_map ? "tab_user_play on tab_user_play.user_id = a.id $game_map" : false) + ->join($game_play_map ? "tab_user_play_info on tab_user_play_info.user_id = a.id $game_play_map" : false) ->page($page, $row) - ->having($havs) + ->having($havs) + ->group('a.id') ->order($order) - ->select(); */ - - $usermodel = M('user', 'tab_'); - - $sql1 = $usermodel->field('tab_user.*,IFNULL(sum(b.pay_amount),0) as deposit_total') - ->join('left join tab_deposit AS b ON tab_user.id = b.user_id AND b.pay_status = 1') - ->where($map) - ->group('tab_user.id') - ->where($hav) - // ->order($order) - ->select(false); - - $data = $usermodel->table('('.$sql1.') as a ')->field('a.id,a.device_number,a.age_status,a.account,a.balance,a.gold_coin,a.alipay,a.promote_id,a.register_type,a.promote_account,a.register_time,a.lock_status,a.register_way,a.register_type,a.register_ip,a.login_time,(a.deposit_total+IFNULL(sum(ss.pay_amount),0)) as recharge_total,check_status') - ->join('left join tab_spend as ss on ss.user_id=a.id AND ss.pay_status = 1') - ->join($game_map ? "tab_user_play on tab_user_play.user_id = a.id $game_map" : false) - ->join($game_play_map ? "tab_user_play_info on tab_user_play_info.user_id = a.id $game_play_map" : false) - ->page($page, $row) - ->having($havs) - ->group('a.id') - ->order($order) - ->select(); - //var_dump($usermodel->getLastSql());die; - - //计数 - - $sql = M('user', 'tab_')->field('tab_user.id,(IFNULL(sum(b.pay_amount),0) + IFNULL(sum(ss.pay_amount),0)) AS recharge_total') + ->select(); + + //计数 + $sql = M('user', 'tab_')->field('tab_user.id,(IFNULL(sum(b.pay_amount),0) + IFNULL(sum(ss.pay_amount),0)) AS recharge_total') ->join('left join tab_deposit AS b ON tab_user.id = b.user_id AND b.pay_status = 1') ->join('left join tab_spend as ss on ss.user_id=tab_user.id AND ss.pay_status = 1') ->join($game_map ? "tab_user_play on tab_user_play.user_id = tab_user.id $game_map" : false) @@ -208,214 +195,237 @@ class MemberController extends ThinkController ->where($map) ->group('tab_user.id') ->where($hav) - ->having($havs)->select(false); -// var_dump($sql);die; - $jcount = M('User','tab_')->field('count(a.id) as count')->table('('.$sql.') as a')->select(); - $count = $jcount[0]['count']; - + ->having($havs)->select(false); + $jcount = M('User', 'tab_')->field('count(a.id) as count')->table('(' . $sql . ') as a')->select(); + $count = $jcount[0]['count']; + $model = M('Model')->getByName('user'); - - if($data) { - - $ids = array_column($data,'id'); - /* 在手里 */ - $small = M('user','tab_')->field('count(id) as count,puid')->where(['puid'=>array('in',$ids)])->group('puid')->select(); - /* 出售中 */ - $small2 = M('user','tab_')->field('count(id) as count,source_puid')->where(['source_puid'=>array('in',$ids),'source_time'=>0])->group('source_puid')->select(); - - foreach($data as $k => $v) { - $data[$k]['small_count'] = 0; - foreach($small as $s) { - if($s['puid'] == $v['id']) { - $data[$k]['small_count'] += $s['count'];break; - } - } - foreach($small2 as $s) { - if($s['source_puid'] == $v['id']) { - $data[$k]['small_count'] += $s['count'];break; - } - } - } - - } - - $page = set_pagination($count,$row); - if($page) {$this->assign('_page', $page);} -//var_dump($model);die; -// var_dump($data);die; + + if ($data) { + + $ids = array_column($data, 'id'); + /* 在手里 */ + $small = M('user', 'tab_')->field('count(id) as count,puid')->where(['puid' => array('in', $ids)])->group('puid')->select(); + /* 出售中 */ + $small2 = M('user', 'tab_')->field('count(id) as count,source_puid')->where(['source_puid' => array('in', $ids), 'source_time' => 0])->group('source_puid')->select(); + + foreach ($data as $k => $v) { + $data[$k]['small_count'] = 0; + foreach ($small as $s) { + if ($s['puid'] == $v['id']) { + $data[$k]['small_count'] += $s['count']; + break; + } + } + foreach ($small2 as $s) { + if ($s['source_puid'] == $v['id']) { + $data[$k]['small_count'] += $s['count']; + break; + } + } + } + + } + + $page = set_pagination($count, $row); + if ($page) { + $this->assign('_page', $page); + } $this->assign('list_data', $data); $this->assign('model', $model); $this->meta_title = "用户信息"; - - $this->m_title = '玩家列表'; - $this->assign('commonset',M('Kuaijieicon')->where(['url'=>'Member/user_info','status'=>1])->find()); + $this->m_title = '玩家列表'; + $this->assign('commonset', M('Kuaijieicon')->where(['url' => 'Member/user_info', 'status' => 1])->find()); + + $this->display(); + } + + /** + * 小号列表 + * @author 鹿文学 + */ + public function small_list($p = 1) + { + + //$map['puid'] = $_GET['id']; + $pid = intval($_GET['id']); + if (is_numeric($pid) && $pid > 0) { + $map['_string'] = ' (puid = ' . $pid . ') or (source_puid = ' . $pid . ' and source_time = 0) '; + $page = intval($p); + $page = $page ? $page : 1; //默认显示第一页数据 + + if (isset($_REQUEST['row'])) { + $row = $_REQUEST['row']; + } else { + $row = 10; + } + + if ($_REQUEST['small']) { + $map['account'] = array('like', '%' . $_REQUEST['small'] . '%'); + } + + $data = M('User', 'tab_') + ->field('id,account,register_time,puid,source_puid,source_time,fgame_id,fgame_name,cumulative,balance,lock_status,DATEDIFF(curdate(),FROM_UNIXTIME(register_time,"%Y-%m-%d")) as day') + // 查询条件 + ->where($map) + /* 默认通过id逆序排列 */ + ->order('register_time desc') + /* 数据分页 */ + ->page($page, $row) + /* 执行查询 */ + ->select(); + + /* 查询记录总数 */ + $count = M('User', 'tab_')->where($map)->count(); + + //分页 + $page = set_pagination($count, $row); + if ($page) { + $this->assign('_page', $page); + } + + $this->assign('list_data', $data); + $this->assign('pid', $pid); + } $this->display(); + } - - /** - * 小号列表 - * @author 鹿文学 - */ - public function small_list($p=1) { - - //$map['puid'] = $_GET['id']; - $pid = intval($_GET['id']); - if(is_numeric($pid) && $pid>0) { - $map['_string'] = ' (puid = '.$pid.') or (source_puid = '.$pid.' and source_time = 0) '; - $page = intval($p); - $page = $page ? $page : 1; //默认显示第一页数据 - - if(isset($_REQUEST['row'])) {$row = $_REQUEST['row'];}else{$row = 10;} - - if($_REQUEST['small']) {$map['account']=array('like','%'.$_REQUEST['small'].'%');} - - $data = M('User', 'tab_') - ->field('id,account,register_time,puid,source_puid,source_time,fgame_id,fgame_name,cumulative,balance,lock_status,DATEDIFF(curdate(),FROM_UNIXTIME(register_time,"%Y-%m-%d")) as day') - // 查询条件 - ->where($map) - /* 默认通过id逆序排列 */ - ->order('register_time desc') - /* 数据分页 */ - ->page($page, $row) - /* 执行查询 */ - ->select(); - - /* 查询记录总数 */ - $count = M('User', 'tab_')->where($map)->count(); - - //分页 - $page = set_pagination($count,$row); - if($page) {$this->assign('_page', $page);} - - $this->assign('list_data', $data); - $this->assign('pid',$pid); + + /** + * 公用小号列表 + * @author 鹿文学 + */ + public function public_small_list($p = 1) + { + $pid = intval($_GET['id']); + if (is_numeric($pid) && $pid > 0) { + $page = intval($p); + $page = $page ? $page : 1; //默认显示第一页数据 + if (isset($_REQUEST['row'])) { + $row = $_REQUEST['row']; + } else { + $row = 10; + } + $map['u.puid'] = $pid; + + if ($_REQUEST['small']) { + $map['u.account'] = array('like', '%' . $_REQUEST['small'] . '%'); + } + + $data = M('User', 'tab_')->alias('u') + ->field('u.id,u.account,u.register_time,u.cumulative,u.balance,fgame_id,fgame_name,u.lock_status,DATEDIFF(curdate(),FROM_UNIXTIME(u.register_time,"%Y-%m-%d")) as day') + ->join('tab_merchandise as m on ((m.status = 3 or m.status=0 or m.status = 4) and m.small_id = u.id) ') + // 查询条件 + ->where($map) + /* 默认通过id逆序排列 */ + ->order('u.register_time desc') + /* 数据分页 */ + ->page($page, $row) + /* 执行查询 */ + ->select(); + + /* 查询记录总数 */ + $count = M('User', 'tab_')->alias('u') + ->join('tab_merchandise as m on ((m.status = 3 or m.status=0 or m.status = 4) and m.small_id = u.id) ') + ->where($map)->count(); + + //分页 + + $page = set_pagination($count, $row); + if ($page) { + $this->assign('_page', $page); + } + + $this->assign('list_data', $data); } $this->display(); - - } - - /** - * 公用小号列表 - * @author 鹿文学 - */ - public function public_small_list($p=1) { - $pid = intval($_GET['id']); - if(is_numeric($pid) && $pid>0) { - $page = intval($p); - $page = $page ? $page : 1; //默认显示第一页数据 - if(isset($_REQUEST['row'])) {$row = $_REQUEST['row'];}else{$row = 10;} - $map['u.puid'] = $pid; - - if($_REQUEST['small']) {$map['u.account']=array('like','%'.$_REQUEST['small'].'%');} - - $data = M('User', 'tab_')->alias('u') - ->field('u.id,u.account,u.register_time,u.cumulative,u.balance,fgame_id,fgame_name,u.lock_status,DATEDIFF(curdate(),FROM_UNIXTIME(u.register_time,"%Y-%m-%d")) as day') - ->join('tab_merchandise as m on ((m.status = 3 or m.status=0 or m.status = 4) and m.small_id = u.id) ') - // 查询条件 - ->where($map) - /* 默认通过id逆序排列 */ - ->order('u.register_time desc') - /* 数据分页 */ - ->page($page, $row) - /* 执行查询 */ - ->select(); - - /* 查询记录总数 */ - $count = M('User', 'tab_')->alias('u') - ->join('tab_merchandise as m on ((m.status = 3 or m.status=0 or m.status = 4) and m.small_id = u.id) ') - ->where($map)->count(); - - //分页 - - $page = set_pagination($count,$row); - if($page) {$this->assign('_page', $page);} - - $this->assign('list_data', $data); - } - $this->display(); - } - - /** - * 金币提现记录 - * @author 鹿文学 - */ - public function gold_coin($p=1,$user_id='') { - - if (is_numeric($user_id) && $user_id>0) { - - $wgc = D('WithdrawGoldCoin'); - - $list = $wgc->listsByUser($p,$user_id); - - $map = array('pay_status'=>1,'user_id'=>$user_id); - - $total = null_to_0($wgc->where($map)->sum('coin')); - $ttotal = null_to_0($wgc->where('create_time' . total(1))->where($map)->sum('coin')); - $poundage = null_to_0($wgc->where($map)->sum('poundage')); - $this->assign('total', $total); - $this->assign('ttotal', $ttotal); - $this->assign('poundage', $poundage); - - $this->assign('list_data',$list); - - } - - $this->display(); - - } - - public function role_list($p=1, $user_id='', $row=10) - { - $limit = ($p-1)*$row . ", $row"; - $list = M("user_play_info", 'tab_')->where(['user_id'=>$user_id])->limit($limit)->order('play_time desc')->select(); - $count = M("user_play_info", 'tab_')->where(['user_id'=>$user_id])->count(); - $page = set_pagination($count,$row); - if($page) {$this->assign('_page', $page);} - $this->assign('list', $list); + } + + /** + * 金币提现记录 + * @author 鹿文学 + */ + public function gold_coin($p = 1, $user_id = '') + { + + if (is_numeric($user_id) && $user_id > 0) { + + $wgc = D('WithdrawGoldCoin'); + + $list = $wgc->listsByUser($p, $user_id); + + $map = array('pay_status' => 1, 'user_id' => $user_id); + + $total = null_to_0($wgc->where($map)->sum('coin')); + $ttotal = null_to_0($wgc->where('create_time' . total(1))->where($map)->sum('coin')); + $poundage = null_to_0($wgc->where($map)->sum('poundage')); + $this->assign('total', $total); + $this->assign('ttotal', $ttotal); + $this->assign('poundage', $poundage); + + $this->assign('list_data', $list); + + } + + $this->display(); + + } + + public function role_list($p = 1, $user_id = '', $row = 10) + { + $limit = ($p - 1) * $row . ", $row"; + $list = M("user_play_info", 'tab_')->where(['user_id' => $user_id])->limit($limit)->order('play_time desc')->select(); + $count = M("user_play_info", 'tab_')->where(['user_id' => $user_id])->count(); + $page = set_pagination($count, $row); + if ($page) { + $this->assign('_page', $page); + } + $this->assign('list', $list); + $this->display(); + } + + /** + * 公用账户 + * @author 鹿文学 + */ + public function public_account() + { + + if (IS_POST) { + $user = new MemberApi(); + if (!empty($data['account'])) { + $data['account'] = str_replace('pa_', '', $data['account']); + } + $res = $user->updateUserInfo($_POST); + + if ($res['status'] !== false) { + \Think\Log::actionLog("Member/public_account", "Member", $id); + $this->success($res['msg'], U('public_account')); + } else { + $this->error($res['msg']); + } + + } else { + + $map['is_platform'] = 1; + $user = D('User'); + $data = $user->where($map)->find(); + + if ($data['id']) { + $data['small_count'] = $user->alias('u')->join('tab_merchandise as m on ((m.status = 3 or m.status=0 or m.status=4) and m.small_id = u.id) ') + ->where(['u.puid' => $data['id']])->count(); + } + + $this->assign('data', $data); + $this->meta_title = "公用账户信息"; + + $this->m_title = '公用账户信息'; + $this->assign('commonset', M('Kuaijieicon')->where(['url' => 'Member/public_account', 'status' => 1])->find()); + $this->display(); } - - /** - * 公用账户 - * @author 鹿文学 - */ - public function public_account() { - - if (IS_POST) { - $user = new MemberApi(); - if(!empty($data['account'])) { - $data['account'] = str_replace('pa_','',$data['account']); - } - $res = $user->updateUserInfo($_POST); - - if ($res['status'] !== false) { - \Think\Log::actionLog("Member/public_account","Member",$id); - $this->success($res['msg'], U('public_account')); - } else { - $this->error($res['msg']); - } - - } else { - - $map['is_platform'] = 1; - $user = D('User'); - $data = $user->where($map)->find(); - - if($data['id']) { - $data['small_count'] = $user->alias('u')->join('tab_merchandise as m on ((m.status = 3 or m.status=0 or m.status=4) and m.small_id = u.id) ') - ->where(['u.puid'=>$data['id']])->count(); - } - - $this->assign('data', $data); - $this->meta_title = "公用账户信息"; - - $this->m_title = '公用账户信息'; - $this->assign('commonset',M('Kuaijieicon')->where(['url'=>'Member/public_account','status'=>1])->find()); - - $this->display(); - } - } + } //设置状态 public function set_status($model = 'User') @@ -437,32 +447,32 @@ class MemberController extends ThinkController } $res = $member->updateInfo($data); if ($res !== false) { - \Think\Log::actionLog("Member/edit","Member",$id); + \Think\Log::actionLog("Member/edit", "Member", $id); $this->success("修改成功", U('user_info')); } else { $this->error("修改失败"); } - + } else { $user = A('User', 'Event'); $data = $user->user_entity($id); - if(is_numeric($data['head_img'])){ - $data['head_img'] = get_cover($data['head_img'],'cover'); + if (is_numeric($data['head_img'])) { + $data['head_img'] = get_cover($data['head_img'], 'cover'); } - if(empty($data['head_img'])){ - $data['head_img'] = $data['sex'] == 1 ?C('TMPL_PARSE_STRING.__IMG__').'/head_women.png':C('TMPL_PARSE_STRING.__IMG__').'/logoo.png'; + if (empty($data['head_img'])) { + $data['head_img'] = $data['sex'] == 1 ? C('TMPL_PARSE_STRING.__IMG__') . '/head_women.png' : C('TMPL_PARSE_STRING.__IMG__') . '/logoo.png'; } $this->assign('data', $data); $this->meta_title = "玩家信息"; - - $spend_totle = M('spend','tab_')->where(['user_id'=>$id,'pay_status'=>1])->sum('pay_amount'); - $deposit_totle = M('deposit','tab_')->where(['user_id'=>$id,'pay_status'=>1])->sum('pay_amount'); - - $this->assign('recharge_total',$spend_totle + $deposit_totle); - - $this->m_title = '玩家列表'; - $this->assign('commonset',M('Kuaijieicon')->where(['url'=>'Member/user_info','status'=>1])->find()); - + + $spend_totle = M('spend', 'tab_')->where(['user_id' => $id, 'pay_status' => 1])->sum('pay_amount'); + $deposit_totle = M('deposit', 'tab_')->where(['user_id' => $id, 'pay_status' => 1])->sum('pay_amount'); + + $this->assign('recharge_total', $spend_totle + $deposit_totle); + + $this->m_title = '玩家列表'; + $this->assign('commonset', M('Kuaijieicon')->where(['url' => 'Member/user_info', 'status' => 1])->find()); + $this->display(); } @@ -495,7 +505,7 @@ class MemberController extends ThinkController /** * 系统非常规MD5加密方法 - * @param string $str 要加密的字符串 + * @param string $str 要加密的字符串 * @return string */ function think_ucenter_md5($str, $key = 'ThinkUCenter') @@ -509,7 +519,7 @@ class MemberController extends ThinkController if ($res) { $this->ajaxReturn(array("status" => 1, "msg" => "成功")); } else { - $this->ajaxReturn(array("status" => -1, "msg"=>"二级密码错误")); + $this->ajaxReturn(array("status" => -1, "msg" => "二级密码错误")); } } @@ -542,7 +552,7 @@ class MemberController extends ThinkController $this->ajaxReturn(array("status" => -1, "msg" => "失败")); } } else { - $this->ajaxReturn(array("status" => -1, "msg"=>"二级密码错误")); + $this->ajaxReturn(array("status" => -1, "msg" => "二级密码错误")); } } @@ -577,7 +587,7 @@ class MemberController extends ThinkController $this->ajaxReturn(array("status" => 0, "msg" => "失败")); } } else { - $this->ajaxReturn(array("status" => 0, "msg"=>"二级密码错误")); + $this->ajaxReturn(array("status" => 0, "msg" => "二级密码错误")); } } @@ -588,9 +598,13 @@ class MemberController extends ThinkController $page = intval($p); $page = $page ? $page : 1; //默认显示第一页数据 $row = 10; - - if(isset($_REQUEST['row'])) {$row = $_REQUEST['row'];}else{$row = 10;} - + + if (isset($_REQUEST['row'])) { + $row = $_REQUEST['row']; + } else { + $row = 10; + } + //$new_model = D($name); $data = M("spend", "tab_") // 查询条件 @@ -605,10 +619,12 @@ class MemberController extends ThinkController /* 查询记录总数 */ $count = M("spend", "tab_")->where($map)->count(); //分页 - - $page = set_pagination($count,$row); - if($page) {$this->assign('_page', $page);} - + + $page = set_pagination($count, $row); + if ($page) { + $this->assign('_page', $page); + } + $total = null_to_0(D('spend')->where($map)->sum('pay_amount')); $ttotal = null_to_0(D('spend')->where('pay_time' . total(1))->where($map)->sum('pay_amount')); $ytotal = null_to_0(D('spend')->where('pay_time' . total(5))->where($map)->sum('pay_amount')); @@ -624,9 +640,9 @@ class MemberController extends ThinkController if (preg_match('/^[1][3578][0-9]{9}/', $_POST['phone'])) { //重复判断 $where['phone'] = $_POST['phone']; - $user = M('User','tab_')->where($where)->field('id,account')->find(); - if ($user){ - $this->ajaxReturn(array("status" => 0, "msg" =>"该手机号已被".$user['account']."(".$user['id'].")绑定")); + $user = M('User', 'tab_')->where($where)->field('id,account')->find(); + if ($user) { + $this->ajaxReturn(array("status" => 0, "msg" => "该手机号已被" . $user['account'] . "(" . $user['id'] . ")绑定")); } $map['id'] = $_POST['id']; @@ -636,7 +652,7 @@ class MemberController extends ThinkController if ($pro !== false) { $this->ajaxReturn(array("status" => 1, "msg" => "手机修改成功")); } else { - $this->ajaxReturn(array("status" => 0, "msg" =>"手机修改失败")); + $this->ajaxReturn(array("status" => 0, "msg" => "手机修改失败")); } } else { $this->ajaxReturn(array("status" => 0, "msg" => "手机输入错误")); @@ -649,8 +665,12 @@ class MemberController extends ThinkController $page = intval($p); $page = $page ? $page : 1; //默认显示第一页数据 $row = 10; - - if(isset($_REQUEST['row'])) {$row = $_REQUEST['row'];}else{$row = 10;} + + if (isset($_REQUEST['row'])) { + $row = $_REQUEST['row']; + } else { + $row = 10; + } $data = M("user_login_record", "tab_") // 查询条件 @@ -664,10 +684,12 @@ class MemberController extends ThinkController /* 查询记录总数 */ $count = M("user_login_record", "tab_")->where($map)->count(); //分页 - - $page = set_pagination($count,$row); - if($page) {$this->assign('_page', $page);} - + + $page = set_pagination($count, $row); + if ($page) { + $this->assign('_page', $page); + } + $this->assign('list_data', $data); $this->display(); } @@ -678,7 +700,7 @@ class MemberController extends ThinkController public function login_record($p = 1) { if (isset($_REQUEST['game_name'])) { - $map['game_name'] = ['like', $_REQUEST['game_name']."%"]; + $map['game_name'] = ['like', $_REQUEST['game_name'] . "%"]; unset($_REQUEST['game_name']); } if (isset($_REQUEST['game_type'])) { @@ -693,11 +715,11 @@ class MemberController extends ThinkController $map['login_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['login_time'] = array('GT',strtotime($_REQUEST['timestart'])); + } elseif (isset($_REQUEST['timestart'])) { + $map['login_time'] = array('GT', strtotime($_REQUEST['timestart'])); unset($_REQUEST['timestart']); - }elseif(isset($_REQUEST['timeend'])){ - $map['login_time'] = array('lt',(strtotime($_REQUEST['timeend'])+ 24 * 60 * 60 - 1)); + } elseif (isset($_REQUEST['timeend'])) { + $map['login_time'] = array('lt', (strtotime($_REQUEST['timeend']) + 24 * 60 * 60 - 1)); unset($_REQUEST['timeend']); } if (isset($_REQUEST['start']) && isset($_REQUEST['end'])) { @@ -713,15 +735,15 @@ class MemberController extends ThinkController $map['server_name'] = $_REQUEST['server_name']; unset($_REQUEST['server_name']); } - // $map['type'] = 1; + // $map['type'] = 1; // $map['login_time'] = ['exp', 'login_time<>0']; $extend = array(); $extend['map'] = $map; - - - $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()); + parent::lists("UserLoginRecord", $p, $extend['map']); } @@ -731,16 +753,16 @@ class MemberController extends ThinkController if (isset($_REQUEST['id'])) { $map['id'] = $_REQUEST['id']; $data = M('user_login_record', 'tab_')->where($map)->delete(); - \Think\Log::actionLog('Member/del','Member',$_REQUEST['id']); + \Think\Log::actionLog('Member/del', 'Member', $_REQUEST['id']); $this->success('删除成功!', U('login_record'), 2); } else { $this->error('请选择要操作的数据!'); } } - public function delprovide($ids=null) + public function delprovide($ids = null) { - if ( empty($ids) ) { + if (empty($ids)) { $this->error('请选择要操作的数据!'); } $list = M("user_login_record", "tab_"); @@ -748,7 +770,7 @@ class MemberController extends ThinkController //$map['status'] = 0; $delete = $list->where($map)->delete(); if ($delete) { - \Think\Log::actionLog('Member/delprovide','Member',1); + \Think\Log::actionLog('Member/delprovide', 'Member', 1); $this->success("批量删除成功!", U("login_record")); } else { $this->error("批量删除失败!", U("login_record")); @@ -765,7 +787,7 @@ class MemberController extends ThinkController $map['id'] = ['in', explode(',', $id)]; $res = M('user', 'tab_')->where($map)->setField(['lock_status' => $lock_status]); if ($res) { - \Think\Log::actionLog('Member/lock_status','Member',$id); + \Think\Log::actionLog('Member/lock_status', 'Member', $id); $this->success('操作成功!'); } else { $this->error('操作失败!'); @@ -826,20 +848,21 @@ class MemberController extends ThinkController * @author: 郭家屯 * @since: 2019/4/29 15:03 */ - public function brush_set(){ - $cate_id = I('cate_id',8); - $group_id = I('group_id',0); + public function brush_set() + { + $cate_id = I('cate_id', 8); + $group_id = I('group_id', 0); $this->m_title = '站点设置(PC官网)'; - $this->assign('commonset',M('Kuaijieicon')->where(['url'=>'Site/media','status'=>1])->find()); + $this->assign('commonset', M('Kuaijieicon')->where(['url' => 'Site/media', 'status' => 1])->find()); $map['status'] = 1; $map['category'] = $cate_id; $map['group'] = $group_id; - $list = M("Config")->where($map)->field('id,name,title,extra,value,remark,type')->order('sort')->select(); - if($list) { - $this->assign('list',$list); + $list = M("Config")->where($map)->field('id,name,title,extra,value,remark,type')->order('sort')->select(); + if ($list) { + $this->assign('list', $list); } - $this->assign('id',$group_id); + $this->assign('id', $group_id); $this->meta_title = '防刷预警设置'; $this->display(); } @@ -850,43 +873,45 @@ class MemberController extends ThinkController * @author: 郭家屯 * @since: 2019/4/30 10:08 */ - public function brush_save($config){ - if($config && is_array($config)){ + public function brush_save($config) + { + if ($config && is_array($config)) { $Config = M('Config'); foreach ($config as $name => $value) { $map = array('name' => $name); - if($name=='CACHE_TYPE' && $value!=0 ){ - $res=$this->check_cache($value,$config['CACHE_TYPE_HOST']); - if($res){ - $this->set_config($name,$value); - }else{ + if ($name == 'CACHE_TYPE' && $value != 0) { + $res = $this->check_cache($value, $config['CACHE_TYPE_HOST']); + if ($res) { + $this->set_config($name, $value); + } else { $this->error('缓存服务器连接不上,开启缓存失败'); } - }elseif ($name=='CACHE_TYPE_HOST'||$name=='CACHE_TYPE_TIME') { - $this->set_config($name,$value); + } elseif ($name == 'CACHE_TYPE_HOST' || $name == 'CACHE_TYPE_TIME') { + $this->set_config($name, $value); } $Config->where($map)->setField('value', $value); } } - S('DB_CONFIG_DATA',null); + S('DB_CONFIG_DATA', null); $this->success('保存成功!'); } /** *设置config */ - private function set_config($name="",$config=""){ - $config_file ="./Application/Common/Conf/pay_config.php"; - if(file_exists($config_file)){ - $configs=include $config_file; - }else { - $configs=array(); + private function set_config($name = "", $config = "") + { + $config_file = "./Application/Common/Conf/pay_config.php"; + if (file_exists($config_file)) { + $configs = include $config_file; + } else { + $configs = array(); } #定义一个数组 $data = array(); #给数组赋值 $data[$name] = $config; - $configs=array_merge($configs,$data); + $configs = array_merge($configs, $data); $result = file_put_contents($config_file, "field('id,account,block_time')->where($map)->order($order)->page($p,$row)->select(); - $count = M('user','tab_')->where($map)->count(); - $this->assign('list_data',$black); - $page = set_pagination($count,$row); - if($page) {$this->assign('_page', $page);} + $black = M('user', 'tab_')->field('id,account,block_time')->where($map)->order($order)->page($p, $row)->select(); + $count = M('user', 'tab_')->where($map)->count(); + $this->assign('list_data', $black); + $page = set_pagination($count, $row); + if ($page) { + $this->assign('_page', $page); + } $this->meta_title = '黑名单列表'; $this->display(); } @@ -922,20 +954,21 @@ class MemberController extends ThinkController * @author: 郭家屯 * @since: 2019/5/5 17:12 */ - public function blockconfig(){ - $cate_id = I('cate_id',9); - $group_id = I('group_id',0); + public function blockconfig() + { + $cate_id = I('cate_id', 9); + $group_id = I('group_id', 0); $this->m_title = '站点设置(PC官网)'; - $this->assign('commonset',M('Kuaijieicon')->where(['url'=>'Site/media','status'=>1])->find()); + $this->assign('commonset', M('Kuaijieicon')->where(['url' => 'Site/media', 'status' => 1])->find()); $map['status'] = 1; $map['category'] = $cate_id; $map['group'] = $group_id; - $list = M("Config")->where($map)->field('id,name,title,extra,value,remark,type')->order('sort')->select(); - if($list) { - $this->assign('list',$list); + $list = M("Config")->where($map)->field('id,name,title,extra,value,remark,type')->order('sort')->select(); + if ($list) { + $this->assign('list', $list); } - $this->assign('id',$group_id); + $this->assign('id', $group_id); $this->meta_title = '拉黑设置'; $this->display(); } @@ -946,78 +979,79 @@ class MemberController extends ThinkController * @author: 郭家屯 * @since: 2019/5/6 10:50 */ - public function deposit_order(){ - $user_id = I('id',0,'intval'); + public function deposit_order() + { + $user_id = I('id', 0, 'intval'); $user_entity = get_user_entity($user_id); //平台币充值订单 $brush_map['user_id'] = $user_entity['id']; $brush_map['pay_status'] = 1; - $brush_map['create_time'] = ['egt',$user_entity['check_time']]; - $deposit_order = M('deposit','tab_')->where($brush_map)->field('id,order_number,pay_order_number,user_id,pay_amount,check_sign,create_time,pay_way,pay_ip')->select(); + $brush_map['create_time'] = ['egt', $user_entity['check_time']]; + $deposit_order = M('deposit', 'tab_')->where($brush_map)->field('id,order_number,pay_order_number,user_id,pay_amount,check_sign,create_time,pay_way,pay_ip')->select(); $abnormal = 0; $deposit_money = 0; $weixn = new Weixin(); - $alipay = new \Think\Pay('alipay'); - foreach ($deposit_order as $key=>$v){ - $sign = get_check_sign($v['user_id'],$v['order_number'],$v['pay_amount'],$v['create_time']); - if($sign != $v['check_sign']){ + $alipay = new \Think\Pay('alipay'); + foreach ($deposit_order as $key => $v) { + $sign = get_check_sign($v['user_id'], $v['order_number'], $v['pay_amount'], $v['create_time']); + if ($sign != $v['check_sign']) { $deposit_order[$key]['error_type'] = '订单标识违规'; - $abnormal ++; + $abnormal++; } - if($v['pay_way'] == 2 || $v['pay_way']==3){ + if ($v['pay_way'] == 2 || $v['pay_way'] == 3) { $deposit_order[$key]['weixin_pay_money'] = $weixn->weixin_block_orderquery($v['order_number']); } - if($v['pay_way'] == 1){ - $deposit_order[$key]['alipay_money'] = $alipay->alipay_orderquery($v['order_number'],$v['pay_order_number']); + if ($v['pay_way'] == 1) { + $deposit_order[$key]['alipay_money'] = $alipay->alipay_orderquery($v['order_number'], $v['pay_order_number']); } $deposit_money += $v['pay_amount']; } - $this->assign('deposit_order',$deposit_order); + $this->assign('deposit_order', $deposit_order); //发放平台币金额 $batch_map['user_id'] = $user_entity['id']; $batch_map['status'] = 1; - $batch_map['create_time'] = ['egt',$user_entity['check_time']]; - $batch_order = M('provide_user','tab_')->field('order_number,pay_order_number,amount,create_time')->where($batch_map)->select(); - $batch_amount = 0 ; - foreach ($batch_order as $key=>$v){ + $batch_map['create_time'] = ['egt', $user_entity['check_time']]; + $batch_order = M('provide_user', 'tab_')->field('order_number,pay_order_number,amount,create_time')->where($batch_map)->select(); + $batch_amount = 0; + foreach ($batch_order as $key => $v) { $batch_amount += $v['amount']; } - $this->assign('batch_order',$batch_order); + $this->assign('batch_order', $batch_order); //积分兑换平台币 $point_map['user_id'] = $user_entity['id']; $point_map['good_type'] = 3; - $point_map['create_time'] = ['egt',$user_entity['check_time']]; - $point_order = M('point_shop_record','tab_')->field('number,create_time')->where($point_map)->select(); + $point_map['create_time'] = ['egt', $user_entity['check_time']]; + $point_order = M('point_shop_record', 'tab_')->field('number,create_time')->where($point_map)->select(); $point_money = 0; - foreach ($point_order as $key=>$v){ + foreach ($point_order as $key => $v) { $point_money += $v['number']; } - $this->assign('point_order',$point_order); + $this->assign('point_order', $point_order); //分享获取平台币 $share_map['invite_id'] = $user_entity['id']; - $share_map['create_time'] = ['egt',$user_entity['check_time']]; - $share_order = M('share_record','tab_')->field('order_number,award_coin as amount,create_time')->where($share_map)->select(); + $share_map['create_time'] = ['egt', $user_entity['check_time']]; + $share_order = M('share_record', 'tab_')->field('order_number,award_coin as amount,create_time')->where($share_map)->select(); $share_amount = 0; - foreach ($share_order as $key=>$v){ + foreach ($share_order as $key => $v) { $share_amount += $v['amount']; } - $this->assign('share_order',$share_order); + $this->assign('share_order', $share_order); //消费平台币金额 $spend_map['user_id'] = $user_entity['id']; $spend_map['pay_status'] = 1; $spend_map['pay_way'] = 0; - $spend_map['pay_time'] = ['egt',$user_entity['check_time']]; - $spend_order = M('spend','tab_')->field('order_number,pay_order_number,user_id,pay_amount,spend_ip,pay_time')->where($spend_map)->select(); + $spend_map['pay_time'] = ['egt', $user_entity['check_time']]; + $spend_order = M('spend', 'tab_')->field('order_number,pay_order_number,user_id,pay_amount,spend_ip,pay_time')->where($spend_map)->select(); $spend_amount = 0; - foreach ($spend_order as $key=>$v){ + foreach ($spend_order as $key => $v) { $spend_amount += $v['pay_amount']; } //统计标识金额 $total_money = floatval($user_entity['balance']) - $deposit_money - $batch_amount - $point_money - $share_amount + floatval($spend_amount) - $user_entity['check_money']; - $this->assign('total_money',abs(round((float)$total_money,2))); - $this->assign('spend_order',$spend_order); - $this->assign('abnormal',$abnormal); - $this->assign('user',$user_entity); + $this->assign('total_money', abs(round((float)$total_money, 2))); + $this->assign('spend_order', $spend_order); + $this->assign('abnormal', $abnormal); + $this->assign('user', $user_entity); $this->display(); } @@ -1027,81 +1061,82 @@ class MemberController extends ThinkController * @author: 郭家屯 * @since: 2019/5/6 10:51 */ - public function bind_order(){ - $user_id = I('id',0,'intval'); + public function bind_order() + { + $user_id = I('id', 0, 'intval'); $user_entity = get_user_entity($user_id); $brush_map['user_id'] = $user_entity['id']; $brush_map['pay_status'] = 1; - $brush_map['create_time'] = ['egt',$user_entity['check_time']]; - $bind_recharge_order = M('bind_recharge','tab_')->where($brush_map)->field('id,user_id,order_number,pay_order_number,amount,user_id,real_amount,check_sign,create_time,zhekou,recharge_ip,pay_way')->select(); + $brush_map['create_time'] = ['egt', $user_entity['check_time']]; + $bind_recharge_order = M('bind_recharge', 'tab_')->where($brush_map)->field('id,user_id,order_number,pay_order_number,amount,user_id,real_amount,check_sign,create_time,zhekou,recharge_ip,pay_way')->select(); $bind_recharge_amount = 0; $abnormal = 0; $weixn = new Weixin(); - $alipay = new \Think\Pay('alipay'); - foreach ($bind_recharge_order as $key=>$v){ - $sign = get_check_sign($v['user_id'],$v['order_number'],$v['amount'],$v['create_time']); - if($sign != $v['check_sign']){ + $alipay = new \Think\Pay('alipay'); + foreach ($bind_recharge_order as $key => $v) { + $sign = get_check_sign($v['user_id'], $v['order_number'], $v['amount'], $v['create_time']); + if ($sign != $v['check_sign']) { $bind_recharge_order[$key]['error_type'] = '订单标识违规'; - $abnormal ++; + $abnormal++; } - if($v['pay_way'] == 2 || $v['pay_way']==3){ + if ($v['pay_way'] == 2 || $v['pay_way'] == 3) { $bind_recharge_order[$key]['weixin_pay_money'] = $weixn->weixin_block_orderquery($v['order_number']); } - if($v['pay_way'] == 1){ - $bind_recharge_order[$key]['alipay_money'] = $alipay->alipay_orderquery($v['order_number'],$v['pay_order_number']); + if ($v['pay_way'] == 1) { + $bind_recharge_order[$key]['alipay_money'] = $alipay->alipay_orderquery($v['order_number'], $v['pay_order_number']); } $bind_recharge_amount += $v['amount']; } - $this->assign('bind_recharge_order',$bind_recharge_order); + $this->assign('bind_recharge_order', $bind_recharge_order); //发放绑币金额 $batch_map['user_id'] = $user_entity['id']; $batch_map['status'] = 1; - $batch_map['create_time'] = ['egt',$user_entity['check_time']]; - $batch_order = M('provide','tab_')->field('order_number,pay_order_number,amount,create_time')->where($batch_map)->select(); + $batch_map['create_time'] = ['egt', $user_entity['check_time']]; + $batch_order = M('provide', 'tab_')->field('order_number,pay_order_number,amount,create_time')->where($batch_map)->select(); $batch_amount = 0; - foreach ($batch_order as $key=>$v){ + foreach ($batch_order as $key => $v) { $batch_amount += $v['amount']; } - $this->assign('batch_order',$batch_order); + $this->assign('batch_order', $batch_order); //消费返利 $rebate_map['user_id'] = $user_entity['id']; - $rebate_map['create_time'] = ['egt',$user_entity['check_time']]; - $rebate_order = M("rebate_list","tab_")->field('pay_order_number,ratio_amount as amount,create_time')->where($rebate_map)->select(); + $rebate_map['create_time'] = ['egt', $user_entity['check_time']]; + $rebate_order = M("rebate_list", "tab_")->field('pay_order_number,ratio_amount as amount,create_time')->where($rebate_map)->select(); $rebate_money = 0; - foreach ($rebate_order as $key=>$v){ + foreach ($rebate_order as $key => $v) { $rebate_money += $v['amount']; } - $this->assign('rebate_order',$rebate_order); + $this->assign('rebate_order', $rebate_order); //会长代充 $agent_map['user_id'] = $user_entity['id']; $agent_map['pay_status'] = 1; - $agent_map['create_time'] = ['egt',$user_entity['check_time']]; - $agent_order = M('agent','tab_')->field('order_number,pay_order_number,amount,real_amount,create_time,zhekou,pay_way')->where($agent_map)->select(); + $agent_map['create_time'] = ['egt', $user_entity['check_time']]; + $agent_order = M('agent', 'tab_')->field('order_number,pay_order_number,amount,real_amount,create_time,zhekou,pay_way')->where($agent_map)->select(); $agent_amount = 0; - foreach ($agent_order as $key=>$v){ + foreach ($agent_order as $key => $v) { $agent_amount += $v['amount']; } - $this->assign('agent_order',$agent_order); + $this->assign('agent_order', $agent_order); //消费平台币金额 $spend_map['user_id'] = $user_entity['id']; $spend_map['pay_status'] = 1; $spend_map['pay_way'] = -1; - $spend_map['pay_time'] = ['egt',$user_entity['check_time']]; - $spend_order = M('spend','tab_')->field('order_number,pay_order_number,user_id,pay_amount,spend_ip,pay_time')->where($spend_map)->select(); + $spend_map['pay_time'] = ['egt', $user_entity['check_time']]; + $spend_order = M('spend', 'tab_')->field('order_number,pay_order_number,user_id,pay_amount,spend_ip,pay_time')->where($spend_map)->select(); $spend_amount = 0; - foreach ($spend_order as $key=>$v){ + foreach ($spend_order as $key => $v) { $spend_amount += $v['pay_amount']; } - $this->assign('spend_order',$spend_order); - $this->assign('abnormal',$abnormal); + $this->assign('spend_order', $spend_order); + $this->assign('abnormal', $abnormal); //检查绑币金额 $check_map['user_id'] = $user_entity['id']; - $check_money = M('user_play','tab_')->where($check_map)->sum('check_money'); - $sum_money = M('user_play','tab_')->where($check_map)->sum('bind_balance'); + $check_money = M('user_play', 'tab_')->where($check_map)->sum('check_money'); + $sum_money = M('user_play', 'tab_')->where($check_map)->sum('bind_balance'); //统计标识金额 - $total_money = $sum_money -$bind_recharge_amount - $batch_amount - $rebate_money - $agent_amount + $spend_amount - $check_money; - $this->assign('total_money',abs(round((float)$total_money,2))); - $this->assign('user',$user_entity); + $total_money = $sum_money - $bind_recharge_amount - $batch_amount - $rebate_money - $agent_amount + $spend_amount - $check_money; + $this->assign('total_money', abs(round((float)$total_money, 2))); + $this->assign('user', $user_entity); $this->display(); } @@ -1111,23 +1146,24 @@ class MemberController extends ThinkController * @author: 郭家屯 * @since: 2019/5/6 10:35 */ - public function block_status(){ - $user_id = I('id',0,'intval'); + public function block_status() + { + $user_id = I('id', 0, 'intval'); $user_entity = get_user_entity($user_id); - if(!$user_entity){ + if (!$user_entity) { $this->error('账号不存在'); } - $model = M('user','tab_'); - $result = $model->execute("update tab_user set check_money=balance,check_status=1,check_time=".time()." where id=".$user_id); - $result1 = $model->execute("update tab_user_play set check_money=bind_balance where user_id=".$user_id); - if($result !== false && $result1 !== false){ + $model = M('user', 'tab_'); + $result = $model->execute("update tab_user set check_money=balance,check_status=1,check_time=" . time() . " where id=" . $user_id); + $result1 = $model->execute("update tab_user_play set check_money=bind_balance where user_id=" . $user_id); + if ($result !== false && $result1 !== false) { $this->success('移除成功'); - }else{ + } else { $this->error('移除失败'); } } - public function device_bans_list($row=10, $type='', $tag='', $p=1) + public function device_bans_list($row = 10, $type = '', $tag = '', $p = 1) { $map = []; if (!empty($type)) { @@ -1138,13 +1174,15 @@ class MemberController extends ThinkController } $list = M('device_bans', 'tab_')->where($map)->page($p, $row)->select(); $count = M('device_bans', 'tab_')->where($map)->count(); - $page = set_pagination($count,$row); - if($page) {$this->assign('_page', $page);} + $page = set_pagination($count, $row); + if ($page) { + $this->assign('_page', $page); + } $this->assign('list_data', $list); $this->display(); } - public function save_device_bans($id='', $type='', $tag='') + public function save_device_bans($id = '', $type = '', $tag = '') { if (empty($id)) { if (IS_GET) { @@ -1159,16 +1197,16 @@ class MemberController extends ThinkController } $map['type'] = $type; $map['tag'] = $tag; - $item = M('device_bans', 'tab_')->where($map)->find(); + $item = M('device_bans', 'tab_')->where($map)->find(); if ($item) { return $this->error("该禁用已经存在(ID:{$item['id']})"); } - M('device_bans', 'tab_')->add(['type'=>$type, 'tag'=>$tag, 'create_time'=>time(), 'operator_id'=>is_login()]); + M('device_bans', 'tab_')->add(['type' => $type, 'tag' => $tag, 'create_time' => time(), 'operator_id' => is_login()]); } - + return $this->success("新增成功", U('Member/device_bans_list')); } else { - M('device_bans', 'tab_')->where(['id'=>$id])->delete(); + M('device_bans', 'tab_')->where(['id' => $id])->delete(); return $this->success("解除成功"); } } diff --git a/Application/Admin/Controller/PromoteCoinController.class.php b/Application/Admin/Controller/PromoteCoinController.class.php index df210e264..c0cc1bc28 100644 --- a/Application/Admin/Controller/PromoteCoinController.class.php +++ b/Application/Admin/Controller/PromoteCoinController.class.php @@ -2,6 +2,7 @@ namespace Admin\Controller; +use Admin\Model\UserModel; use Think\Model; use Base\Service\PromoteService; @@ -9,233 +10,243 @@ use Base\Service\PromoteService; * 后台首页控制器 * @author 麦当苗儿 */ -class PromoteCoinController extends ThinkController { +class PromoteCoinController extends ThinkController +{ - const model_name = 'PromoteCoin'; + const model_name = 'PromoteCoin'; - public function send_lists($p=0){ - if(empty($_GET['promote_id']&&$_GET['promote_type'])){ - $extend['type'] = 1; - $extend['source_id'] = 0; - $map = $extend; - }else{ - $extend['promote_id'] = $_GET['promote_id']; - $extend['promote_type'] = $_GET['promote_type']; + public function send_lists($p = 0) + { + if (empty($_GET['promote_id'] && $_GET['promote_type'])) { + $extend['type'] = 1; + $extend['source_id'] = 0; + $map = $extend; + } else { + $extend['promote_id'] = $_GET['promote_id']; + $extend['promote_type'] = $_GET['promote_type']; - } + } - $map['create_time'] = total(1,false); + $map['create_time'] = total(1, false); $sum['to_day'] = D(self::model_name)->where($map)->sum('num'); - $map['create_time'] = total(5,false); + $map['create_time'] = total(5, false); $sum['yst_day'] = D(self::model_name)->where($map)->sum('num'); $sum['all_num'] = D(self::model_name)->where($extend)->sum('num'); - // echo D(self::model_name)->getLastSql();exit; - $this->assign('sum',$sum); + // echo D(self::model_name)->getLastSql();exit; + $this->assign('sum', $sum); - $this->m_title = '平台币发放(推广员)'; - $this->assign('commonset',M('Kuaijieicon')->where(['url'=>'PromoteCoin/send_lists','status'=>1])->find()); + $this->m_title = '平台币发放(推广员)'; + $this->assign('commonset', M('Kuaijieicon')->where(['url' => 'PromoteCoin/send_lists', 'status' => 1])->find()); - parent::order_lists(self::model_name,$_GET["p"],$extend); + parent::order_lists(self::model_name, $_GET["p"], $extend); } - public function deduct_lists($p=0){ - if(isset($_GET['type'])&&$_GET['type']==2){ + public function deduct_lists($p = 0) + { + if (isset($_GET['type']) && $_GET['type'] == 2) { $extend['type'] = 2; $extend['source_id'] = 0; $map = $extend; - $model_name=self::model_name; - }else{ - $model_name="user_coin"; - if(isset($_GET['account'])){ - $extend['user_account']= array('like','%'.I('account').'%') ; + $model_name = self::model_name; + } else { + $model_name = "user_coin"; + if (isset($_GET['account'])) { + $extend['user_account'] = array('like', '%' . I('account') . '%'); } } - $map['create_time'] = total(1,false); + $map['create_time'] = total(1, false); $sum['to_day'] = D(self::model_name)->where($map)->sum('num'); - $map['create_time'] = total(5,false); + $map['create_time'] = total(5, false); $sum['yst_day'] = D(self::model_name)->where($map)->sum('num'); - $model_name = empty($model_name)?self::model_name:$model_name; + $model_name = empty($model_name) ? self::model_name : $model_name; $sum['all_num'] = D($model_name)->where($extend)->sum('num'); - $this->assign('sum',$sum); - - $this->m_title = '平台币收回'; - $this->assign('commonset',M('Kuaijieicon')->where(['url'=>'PromoteCoin/deduct_lists','status'=>1])->find()); - - - parent::order_lists($model_name,$_GET["p"],$extend); - + $this->assign('sum', $sum); + $this->m_title = '平台币收回'; + $this->assign('commonset', M('Kuaijieicon')->where(['url' => 'PromoteCoin/deduct_lists', 'status' => 1])->find()); + parent::order_lists($model_name, $_GET["p"], $extend); } /** - *扣除绑定币记录列表 - */ - public function deductBindBanlanList(){ - if(isset($_GET['type'])&&$_GET['type']==2){ + *扣除绑定币记录列表 + */ + public function deductBindBanlanList() + { + if (isset($_GET['type']) && $_GET['type'] == 2) { $extend['type'] = 2; $extend['source_id'] = 0; $map = $extend; - $model_name=self::model_name; - }else{ - $model_name="user_coin"; - if(isset($_GET['user_id'])){ - $extend['user_id']=I('user_id'); + $model_name = self::model_name; + } else { + $model_name = "user_coin"; + if (isset($_GET['user_id'])) { + $extend['user_id'] = I('user_id'); } } - $map['create_time'] = total(1,false); + $map['create_time'] = total(1, false); $sum['to_day'] = D(self::model_name)->where($map)->sum('num'); - $map['create_time'] = total(5,false); + $map['create_time'] = total(5, false); $sum['yst_day'] = D(self::model_name)->where($map)->sum('num'); $sum['all_num'] = D(self::model_name)->where($extend)->sum('num'); - $this->assign('sum',$sum); - parent::order_lists($model_name,$_GET["p"],$extend); + $this->assign('sum', $sum); + parent::order_lists($model_name, $_GET["p"], $extend); } /** * 发放平台币 */ - public function send(){ + public function send() + { $this->m_title = '平台币发放(推广员)'; - - $this->assign('commonset', M('Kuaijieicon')->where(['url'=>'PromoteCoin/send_lists','status'=>1])->find()); - $this->add(1,'send_lists',2); - } - - public function deduct(){ - $this->m_title = '平台币收回'; - $this->assign('commonset',M('Kuaijieicon')->where(['url'=>'PromoteCoin/deduct_lists','status'=>1])->find()); + $this->assign('commonset', M('Kuaijieicon')->where(['url' => 'PromoteCoin/send_lists', 'status' => 1])->find()); + $this->add(1, 'send_lists', 2); + } - $this->add(2,'deduct_lists',$_REQUEST['typee']?$_REQUEST['typee']:1); + public function deduct() + { + $this->m_title = '平台币收回'; + $this->assign('commonset', M('Kuaijieicon')->where(['url' => 'PromoteCoin/deduct_lists', 'status' => 1])->find()); + $this->add(2, 'deduct_lists', $_REQUEST['typee'] ? $_REQUEST['typee'] : 1); } - public function add($type,$url,$tt=1) + public function add($type, $url, $tt = 1) { $model = M('Model')->getByName(self::model_name); $model || $this->error('模型不存在!'); - if(IS_POST){ + if (IS_POST) { //验证二级密码 $pwd = I('second_pwd'); $res = D('Member')->check_sc_pwd($pwd); - if(!$res){ + if (!$res) { $this->error('二级密码错误'); } - $model_name=$tt==1?"UserCoin":"PromoteCoin"; + $model_name = $tt == 1 ? "UserCoin" : "PromoteCoin"; $res = D($model_name)->create(); - if (!$res){ + if (!$res) { $this->error(D($model_name)->getError()); } //平台币修改 - if($tt==1){ - $res = D('User')->edit_user_balance_coin(I('user_id'),abs(I('num'))); - }else{ + if ($tt == 1) { + $res = D('User')->edit_user_balance_coin(I('user_id'), abs(I('num'))); + } else { $promoteService = new PromoteService(); if ($type == 1) { $res = $promoteService->adminIncCoin(I('promote_id'), abs(I('num')), session('user_auth.uid')); } elseif ($type == 2) { - $res = $promoteService->adminDecCoin(I('promote_id'), abs(I('num')), session('user_auth.uid')); + $res = $promoteService->adminDecCoin(I('promote_id'), abs(I('num')), session('user_auth.uid')); } } - if($res){ - $this->success('操作成功!', U($url,array('model'=>$model['name'],'type'=>$tt))); + if ($res) { + $this->success('操作成功!', U($url, array('model' => $model['name'], 'type' => $tt))); } else { - $this->error('操作失败!',U($url,array('model'=>$model['name'],'type'=>$tt))); + $this->error('操作失败!', U($url, array('model' => $model['name'], 'type' => $tt))); } } else { - $fields = get_model_attribute($model['id']); $this->assign('model', $model); $this->assign('fields', $fields); $this->meta_title = '平台币操作'; - $this->display($model['template_add']?$model['template_add']:''); + $this->display($model['template_add'] ? $model['template_add'] : ''); } } /** * 平台币转移记录 */ - public function record($p=0){ + public function record($p = 0) + { $extend['type'] = 2; - $extend['source_id'] = ['neq',0]; + $extend['source_id'] = ['neq', 0]; - if(isset($_REQUEST['promote_id'])) {$extend['promote_id'] = $_REQUEST['promote_id'];} - $source_ids = []; - if (!empty($_REQUEST['source_id'])) $source_ids[] = $_REQUEST['source_id']; - if (!empty($_REQUEST['grand_id'])) $source_ids[] = $_REQUEST['grand_id']; - if (!empty($_REQUEST['child_id'])) $source_ids[] = $_REQUEST['child_id']; - if (!empty($source_ids)) $extend['source_id'] = ['in', $source_ids]; + if (isset($_REQUEST['promote_id'])) { + $extend['promote_id'] = $_REQUEST['promote_id']; + } + $source_ids = []; + if (!empty($_REQUEST['source_id'])) $source_ids[] = $_REQUEST['source_id']; + if (!empty($_REQUEST['grand_id'])) $source_ids[] = $_REQUEST['grand_id']; + if (!empty($_REQUEST['child_id'])) $source_ids[] = $_REQUEST['child_id']; + if (!empty($source_ids)) $extend['source_id'] = ['in', $source_ids]; $map = $extend; - $map['create_time'] = total(1,false); + $map['create_time'] = total(1, false); $sum['to_day'] = D(self::model_name)->where($map)->sum('num'); - $map['create_time'] = total(5,false); + $map['create_time'] = total(5, false); $sum['yst_day'] = D(self::model_name)->where($map)->sum('num'); $sum['all_num'] = D(self::model_name)->where($extend)->sum('num'); - $this->assign('sum',$sum); + $this->assign('sum', $sum); $this->meta_title = '平台币转移记录'; - $this->m_title = '平台币转移记录'; - $this->assign('commonset',M('Kuaijieicon')->where(['url'=>'PromoteCoin/record','status'=>1])->find()); + $this->m_title = '平台币转移记录'; + $this->assign('commonset', M('Kuaijieicon')->where(['url' => 'PromoteCoin/record', 'status' => 1])->find()); /* //parent::order_lists(self::model_name,$_GET["p"],$extend); */ - $page = intval($p); + $page = intval($p); $page = $page ? $page : 1; - if(isset($_REQUEST['row'])) {$row = $_REQUEST['row'];}else{$row = 10;} + if (isset($_REQUEST['row'])) { + $row = $_REQUEST['row']; + } else { + $row = 10; + } - $pc = D(self::model_name); + $pc = D(self::model_name); - $data=$pc->alias('c') - ->field('c.*,p.account as source_name, p.parent_id, p.level') - ->join('tab_promote p on c.source_id = p.id', 'left') - ->where($extend) - ->order('id desc') - ->page($page,$row) - ->select(); + $data = $pc->alias('c') + ->field('c.*,p.account as source_name, p.parent_id, p.level') + ->join('tab_promote p on c.source_id = p.id', 'left') + ->where($extend) + ->order('id desc') + ->page($page, $row) + ->select(); - $count = $pc->where($extend)->count(); + $count = $pc->where($extend)->count(); - $page = set_pagination($count,$row); - if($page) {$this->assign('_page', $page);} + $page = set_pagination($count, $row); + if ($page) { + $this->assign('_page', $page); + } - $this->assign('list_data', $data); + $this->assign('list_data', $data); - $this->display(); + $this->display(); } + //获取线下充值列表 - public function offlineList($p=0) + public function offlineList($p = 0) { //获取记录 $map = array(); $map['pay_type'] = 2; $map['is_del'] = 0; //其他条件查询 - if(isset($_REQUEST['promote_account'])){ - $map['promote_account']=array('like','%'.trim($_REQUEST['promote_account']).'%'); - unset($_REQUEST['promote_account']); - } - if(isset($_REQUEST['time-start'])&&isset($_REQUEST['time-end'])){ - $map['create_time'] =array('BETWEEN',array(strtotime($_REQUEST['time-start']),strtotime($_REQUEST['time-end'])+24*60*60-1)); - unset($_REQUEST['time-start']);unset($_REQUEST['time-end']); - }elseif(isset($_REQUEST['time-start'])){ - $map['create_time'] = ['GT',strtotime(I('time-start'))]; + if (isset($_REQUEST['promote_account'])) { + $map['promote_account'] = array('like', '%' . trim($_REQUEST['promote_account']) . '%'); + unset($_REQUEST['promote_account']); + } + if (isset($_REQUEST['time-start']) && isset($_REQUEST['time-end'])) { + $map['create_time'] = array('BETWEEN', array(strtotime($_REQUEST['time-start']), strtotime($_REQUEST['time-end']) + 24 * 60 * 60 - 1)); + unset($_REQUEST['time-start']); + unset($_REQUEST['time-end']); + } elseif (isset($_REQUEST['time-start'])) { + $map['create_time'] = ['GT', strtotime(I('time-start'))]; unset($_REQUEST['time-start']); - }elseif(isset($_REQUEST['time-end'])){ - $map['create_time'] = ['LT',strtotime(I('time-end'))+86399]; + } elseif (isset($_REQUEST['time-end'])) { + $map['create_time'] = ['LT', strtotime(I('time-end')) + 86399]; unset($_REQUEST['time-end']); } - if(isset($_REQUEST['order_status'])){ - $map['order_status']=$_REQUEST['order_status']; + if (isset($_REQUEST['order_status'])) { + $map['order_status'] = $_REQUEST['order_status']; unset($_REQUEST['order_status']); } $data = D("CoinPayOrder")->lists($_GET["p"], $map, $order); @@ -243,14 +254,15 @@ class PromoteCoinController extends ThinkController { //执行查询 // parent::order_lists("CoinPayOrder",$_GET["p"],$extend); $this->meta_title = '线下充值审核列表'; - $this->assign('list_data',$data['data']); - $this->assign('_page',$data['page']); + $this->assign('list_data', $data['data']); + $this->assign('_page', $data['page']); $this->display(); # code... } + public function offlineOrderInfo() { - if(!isset($_REQUEST['id'])){ + if (!isset($_REQUEST['id'])) { exit("参数错误"); } $id = $_REQUEST['id']; @@ -260,31 +272,33 @@ class PromoteCoinController extends ThinkController { $this->display(); # code... } + //审核通过 public function offlineAgree() { - if(!isset($_REQUEST['ids']) || count($_REQUEST['ids']) < 1){ + if (!isset($_REQUEST['ids']) || count($_REQUEST['ids']) < 1) { exit("参数错误"); } $ids = I("ids"); $count = count($ids); //执行操作 - for ($i=0; $i <$count; $i++) { + for ($i = 0; $i < $count; $i++) { $this->doOfflineAgree($ids[$i]); } $this->success("批量通过成功"); # code... } + //批量审核拒绝 public function offlineReject() { - if(!isset($_REQUEST['ids']) || count($_REQUEST['ids']) < 1){ + if (!isset($_REQUEST['ids']) || count($_REQUEST['ids']) < 1) { exit("参数错误"); } $ids = I("ids"); $count = count($ids); //执行操作 - for ($i=0; $i <$count; $i++) { + for ($i = 0; $i < $count; $i++) { $this->orderReject($ids[$i]); } $this->success("批量拒绝成功"); @@ -295,77 +309,110 @@ class PromoteCoinController extends ThinkController { { //获取记录 $order = D("CoinPayOrder")->info($id); - if($order['order_status'] != 2){ + if ($order['order_status'] != 2) { return; } // $balance_map['promote_id'] = $order['promote_id']; $balance_map['game_id'] = 0; $balance = M('promote_balance_coin', 'tab_')->where($balance_map)->find(); - $this->balance_coin_update($order,$balance);//更新汇总 - $this->coin_record_add($order,$balance); //添加流水 + $this->balance_coin_update($order, $balance);//更新汇总 + $this->coin_record_add($order, $balance); //添加流水 $this->promote_balance_coin_update($order); //更新推广员平台币余额 $this->orderAgree($id);//更新表 } + public function orderReject($id) { $order = D("CoinPayOrder")->info($id); - if($order['order_status'] != 2){ + if ($order['order_status'] != 2) { return; } $savedata = array(); $auth = $_SESSION['onethink_admin']['user_auth']; - $savedata['auditor_id']=$auth['uid']; - $savedata['auditor_account']=$auth['username']; - $savedata['auditor_time']=time(); - $savedata['order_status']=-1; - D("CoinPayOrder")->updateData($savedata,$id); + $savedata['auditor_id'] = $auth['uid']; + $savedata['auditor_account'] = $auth['username']; + $savedata['auditor_time'] = time(); + $savedata['order_status'] = -1; + D("CoinPayOrder")->updateData($savedata, $id); # code... } + public function orderAgree($id) { $savedata = array(); $auth = $_SESSION['onethink_admin']['user_auth']; - $savedata['auditor_id']=$auth['uid']; - $savedata['auditor_account']=$auth['username']; - $savedata['auditor_time']=time(); - $savedata['order_status']=4; - D("CoinPayOrder")->updateData($savedata,$id); + $savedata['auditor_id'] = $auth['uid']; + $savedata['auditor_account'] = $auth['username']; + $savedata['auditor_time'] = time(); + $savedata['order_status'] = 4; + D("CoinPayOrder")->updateData($savedata, $id); # code... } - // 添加流水 - public function coin_record_add($order,$balance){ - $data['sn']=date('Ymd') . date('His') . sp_random_num(6); - $data['type']=1; - $data['sub_type'] =1; + + // 添加流水 + public function coin_record_add($order, $balance) + { + $data['sn'] = date('Ymd') . date('His') . sp_random_num(6); + $data['type'] = 1; + $data['sub_type'] = 1; $data['target_id'] = $order['promote_id']; $data['target_type'] = 1; $data['ref_id'] = $order['id']; $data['coin'] = $order['real_amount']; - $data['balance_coin'] = $balance['num']+$order['coin_num']; + $data['balance_coin'] = $balance['num'] + $order['coin_num']; $data['remark'] = $order['remark']; - $data['create_time']=time(); - $data['description']='线下充值'; + $data['create_time'] = time(); + $data['description'] = '线下充值'; M('promote_coin_record', 'tab_')->data($data)->add(); } //更新汇总 - public function balance_coin_update($order,$balance){ - if(!empty($balance)){ + public function balance_coin_update($order, $balance) + { + if (!empty($balance)) { $map['promote_id'] = $order['promote_id']; $map['game_id'] = 0; - M('promote_balance_coin', 'tab_')->where($map)->setInc('num',$order['coin_num']); - }else{ - $balance['promote_id']= $order['promote_id']; + M('promote_balance_coin', 'tab_')->where($map)->setInc('num', $order['coin_num']); + } else { + $balance['promote_id'] = $order['promote_id']; $balance['game_id'] = 0; - $balance['num']=$order['coin_num']; + $balance['num'] = $order['coin_num']; M('promote_balance_coin', 'tab_')->data($balance)->add(); } } //更新推广员平台币余额 - public function promote_balance_coin_update($order){ + public function promote_balance_coin_update($order) + { $map['id'] = $order['promote_id']; - M('promote', 'tab_')->where($map)->setInc('balance_coin',$order['coin_num']); + M('promote', 'tab_')->where($map)->setInc('balance_coin', $order['coin_num']); + } + + //玩家账号查询 + public function getUserAccount() + { + $account = trim(I('post.account', '')); + if (empty($account)) { + $data['status'] = -1; + $data['msg'] = '请输入玩家账号'; + $this->ajaxReturn($data); + } + $map['account'] = $account; + $user = M('user', 'tab_')->field('id,account,balance')->where($map)->find(); + if (empty($user)) { + $data['status'] = 0; + $data['msg'] = '该玩家账号不存在'; + } else { + $data['status'] = 1; + $data['user'] = $user; + } + $this->ajaxReturn($data); + } + + public function checkUsername($account) + { + $model = new UserModel(); + return $model->checkUsername($account); } } diff --git a/Application/Admin/Controller/PromoteController.class.php b/Application/Admin/Controller/PromoteController.class.php index ecf159a88..e4e3cd5d1 100644 --- a/Application/Admin/Controller/PromoteController.class.php +++ b/Application/Admin/Controller/PromoteController.class.php @@ -483,15 +483,15 @@ unset($_REQUEST['parent_id']); unset($_REQUEST['spend_ip']); } - if(isset($_REQUEST['time-start'])&&isset($_REQUEST['time-end'])){ - $map['pay_time']=array('BETWEEN',array(strtotime($_REQUEST['time-start']),strtotime($_REQUEST['time-end'])+24*60*60-1)); - unset($_REQUEST['time-start']);unset($_REQUEST['time_end']); - }elseif(isset($_REQUEST['time-start'])){ - $map['pay_time'] = ['GT',strtotime(I('time-start'))]; - unset($_REQUEST['time-start']); - }elseif(isset($_REQUEST['time-end'])){ - $map['pay_time'] = ['LT',strtotime(I('time-end'))+86399]; - unset($_REQUEST['time-end']); + if(isset($_REQUEST['timeStart'])&&isset($_REQUEST['timeEnd'])){ + $map['pay_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['pay_time'] = ['GT',strtotime(I('timeStart'))]; + unset($_REQUEST['timeStart']); + }elseif(isset($_REQUEST['timeEnd'])){ + $map['pay_time'] = ['LT',strtotime(I('timeEnd'))+86399]; + unset($_REQUEST['timeEnd']); } if(isset($_REQUEST['start'])&&isset($_REQUEST['end'])){ $map['pay_time']=array('BETWEEN',array(strtotime($_REQUEST['start']),strtotime($_REQUEST['end'])+24*60*60-1)); diff --git a/Application/Admin/Controller/RechargeSumController.class.php b/Application/Admin/Controller/RechargeSumController.class.php index 4a6055766..c877ce33e 100644 --- a/Application/Admin/Controller/RechargeSumController.class.php +++ b/Application/Admin/Controller/RechargeSumController.class.php @@ -1,160 +1,156 @@ field('register_time')->order('id asc')->find(); - $starttime = strtotime(date('Y-m-d',$user['register_time'])); - $endtime = strtotime($_REQUEST['timeEnd']); - } else { - $user = D('User')->field('register_time')->order('id asc')->find(); - - $starttime = strtotime(date('Y-m-d',$user['register_time'])); - $endtime = strtotime(date('Y-m-d')); - - } - - $key = 0; - - $total = ['current'=>0,'sum'=>0]; - - if(isset($_REQUEST['promote_id'])){ - if ($_REQUEST['promote_id'] > 0) { - $promoter_ids = D("Promote")->where("chain like '%/{$_REQUEST['promote_id']}/%' or id={$_REQUEST['promote_id']}")->field('id')->select(); - $promoter_ids ? $rmap['tab_user.promote_id'] = $map['promote_id'] = ['in', implode(',', array_column($promoter_ids, 'id'))] : null; - } else { - $rmap['tab_user.promote_id'] = $map['promote_id'] = 0; - } - } - - for($start = $endtime; $start >= $starttime;$start -= 86400) - { - $startDate = $start; - $endDate = $startDate + 24*60*60-1; - $rmap['register_time'] = $map['register_time'] = array('BETWEEN',array($startDate,$endDate)); - $map['play_time'] = array('BETWEEN',array($startDate,$endDate)); - $map['pay_time'] = array('BETWEEN',array($startDate,$endDate)); - if(!empty($_REQUEST['game_type'])){ - $map['sdk_version'] = $_REQUEST['game_type']; - $rmap['sdk_version'] = $_REQUEST['game_type']; - } - - if(!empty($_REQUEST['game_name'])){ - $rmap['game_id'] = $map['game_id'] = ['in', array_column(getGameByName($_REQUEST['game_name'], $_REQUEST['game_type']), 'id')]; - } - - if (!empty($_REQUEST['server_name'])) { - $rmap['server_name'] = $map['server_name'] = $_REQUEST['server_name']; - } - - if($_REQUEST['bindcoin']==1) { - $map['pay_way'] = array('egt',0); - } - - //当天注册人数 - $registerNum = D('User')->where(array_merge($rmap,array('puid'=>0)))->join("tab_user_play on tab_user.id = tab_user_play.user_id and tab_user.fgame_id = tab_user_play.game_id")->field("tab_user.id")->select(); - $registerNum = $registerNum ? array_column($registerNum, 'id') : []; - - //当天活跃人数 - $livenNum = D('UserPlay')->where($map)->count("id"); - - //当天新增付费 - if(empty($registerNum)){ - $map['user_id'] = array('IN','0'); - }else{ - $map['user_id'] = array('IN',$registerNum); - } - - $map['pay_status'] = 1; - $newAddPay = D('Spend')->where(array_merge($map,array('_string'=>'( small_id = 0 or small_id = user_id)')))->sum('pay_amount'); - - //当天累计付费 - unset($map['user_id']); - $accumulated = D('Spend')->where($map)->sum('pay_amount'); - - $data[$key]['date'] = date('Y-m-d',$start); - $data[$key]['game_id'] = empty($_REQUEST['game_id'])?"全部":get_game_name($_REQUEST['game_id']); - switch ($_REQUEST['promote_id']) { - case 'GUANFANG': - $data[$key]['promote_id'] = "官方渠道"; - break; - case 0: - $data[$key]['promote_id'] = "官方渠道"; - break; - case 'PROMOTE': - $data[$key]['promote_id'] = "推广渠道"; - break; - case 'ALL': - $data[$key]['promote_id'] = "全部"; - break; - default: - $data[$key]['promote_id'] = empty($_REQUEST['promote_id'])?"全部":get_promote_account($_REQUEST['promote_id']); - break; - } - $data[$key]['registerNum'] = count($registerNum); - $data[$key]['livenNum'] = $livenNum; - $data[$key]['newAddPay'] = empty($newAddPay)?0:$newAddPay; - $data[$key]['accumulated'] = empty($accumulated)?0:$accumulated; - - $total['sum'] += $data[$key]['accumulated']; - - $key++; - } - - if(isset($_REQUEST['row'])) {$row = $_REQUEST['row'];}else{$row = 10;} - - $count = count($data); - - $page = set_pagination($count,$row); - if($page) {$this->assign('_page', $page);} - - $pnum = ceil(count($data) / $row); //总页数,ceil()函数用于求大于数字的最小整数 - //用array_slice(array,offset,length) 函数在数组中根据条件取出一段值;array(数组),offset(元素的开始位置),length(组的长度) - $data = array_slice($data, ($p-1)*$row, $row); - - foreach($data as $k=>$v) { - $total['current'] += $v['accumulated']; - } - - - //判断是否执行导出 - if(I('export')==1){ - $this->exportSum($data); - } - $this->assign('meta_title',"充值汇总"); - $this->assign('list_data',$data); - $this->assign('total',$total); - - $this->m_title = '充值汇总'; - $this->assign('commonset',M('Kuaijieicon')->where(['url'=>'RechargeSum/summation','status'=>1])->find()); - - - $this->display(); - } - - public function exportSum($data){ - $export = A('Export'); - $exptitle = $_REQUEST['xlsname']; - $expCellName = array( - array('date','日期'), - array('promote_id','渠道来源'), - array('game_id','游戏名称'), - array('registerNum','新增人数'), - array('livenNum','活跃人数'), - array('newAddPay',"新增玩家付费"), - array('accumulated','本日累计'), - ); - $expTableData = $data; - $export->exportExcel($exptitle,$expCellName,$expTableData); - } +class RechargeSumController extends ThinkController +{ + + public function summation($p = 1) + { + $startDateTime = empty($_REQUEST['timeStart']) ? date('Y-m-d', strtotime('-6 day', time())) : $_REQUEST['timeStart']; + $endDateTime = empty($_REQUEST['timeEnd']) ? date('Y-m-d') : $_REQUEST['timeEnd']; + $startTime = strtotime($startDateTime); + $endTime = strtotime($endDateTime); + $key = 0; + $total = ['current' => 0, 'sum' => 0]; + if (isset($_REQUEST['promote_id'])) { + if ($_REQUEST['promote_id'] > 0) { + $promoter_ids = D("Promote")->where("chain like '%/{$_REQUEST['promote_id']}/%' or id={$_REQUEST['promote_id']}")->field('id')->select(); + $promoter_ids ? $rmap['tab_user.promote_id'] = $map['promote_id'] = ['in', implode(',', array_column($promoter_ids, 'id'))] : null; + } else { + $rmap['tab_user.promote_id'] = $map['promote_id'] = 0; + } + } + + $data = []; + if (intval(($endTime + (24 * 3600)) - $startTime) / (24 * 3600) <= 31) { + for ($start = $endTime; $start >= $startTime; $start -= 86400) { + $startDate = $start; + $endDate = $startDate + 24 * 60 * 60 - 1; + $rmap['register_time'] = $map['register_time'] = array('BETWEEN', array($startDate, $endDate)); + $map['play_time'] = array('BETWEEN', array($startDate, $endDate)); + $map['pay_time'] = array('BETWEEN', array($startDate, $endDate)); + if (!empty($_REQUEST['game_type'])) { + $map['sdk_version'] = $_REQUEST['game_type']; + $rmap['sdk_version'] = $_REQUEST['game_type']; + } + + if (!empty($_REQUEST['game_name'])) { + $rmap['game_id'] = $map['game_id'] = ['in', array_column(getGameByName($_REQUEST['game_name'], $_REQUEST['game_type']), 'id')]; + } + + if (!empty($_REQUEST['server_id'])) { + $rmap['tab_user_play.server_id'] = $map['server_id'] = $_REQUEST['server_id']; + } + + if ($_REQUEST['bindcoin'] == 1) { + $map['pay_way'] = array('egt', 0); + } + + //当天注册人数 + $registerNum = D('User')->where(array_merge($rmap, array('puid' => 0)))->join("tab_user_play on tab_user.id = tab_user_play.user_id and tab_user.fgame_id = tab_user_play.game_id")->field("tab_user.id")->select(); + $registerNum = $registerNum ? array_column($registerNum, 'id') : []; + + //当天活跃人数 + $livenNum = D('UserPlay')->where($map)->count("id"); + + //当天新增付费 + if (empty($registerNum)) { + $map['user_id'] = array('IN', '0'); + } else { + $map['user_id'] = array('IN', $registerNum); + } + + $map['pay_status'] = 1; + $newAddPay = D('Spend')->where(array_merge($map, array('_string' => '( small_id = 0 or small_id = user_id)')))->sum('pay_amount'); + + //当天累计付费 + unset($map['user_id']); + $accumulated = D('Spend')->where($map)->sum('pay_amount'); + + $data[$key]['date'] = date('Y-m-d', $start); + $data[$key]['game_id'] = empty($_REQUEST['game_id']) ? "全部" : get_game_name($_REQUEST['game_id']); + switch ($_REQUEST['promote_id']) { + case 'GUANFANG': + $data[$key]['promote_id'] = "官方渠道"; + break; + case 0: + $data[$key]['promote_id'] = "官方渠道"; + break; + case 'PROMOTE': + $data[$key]['promote_id'] = "推广渠道"; + break; + case 'ALL': + $data[$key]['promote_id'] = "全部"; + break; + default: + $data[$key]['promote_id'] = empty($_REQUEST['promote_id']) ? "全部" : get_promote_account($_REQUEST['promote_id']); + break; + } + $data[$key]['registerNum'] = count($registerNum); + $data[$key]['livenNum'] = $livenNum; + $data[$key]['newAddPay'] = empty($newAddPay) ? 0 : $newAddPay; + $data[$key]['accumulated'] = empty($accumulated) ? 0 : $accumulated; + + $total['sum'] += $data[$key]['accumulated']; + + $key++; + } + } + + if (isset($_REQUEST['row'])) { + $row = $_REQUEST['row']; + } else { + $row = 10; + } + + $count = count($data); + + $page = set_pagination($count, $row); + if ($page) { + $this->assign('_page', $page); + } + + $pnum = ceil(count($data) / $row); //总页数,ceil()函数用于求大于数字的最小整数 + //用array_slice(array,offset,length) 函数在数组中根据条件取出一段值;array(数组),offset(元素的开始位置),length(组的长度) + $data = array_slice($data, ($p - 1) * $row, $row); + + foreach ($data as $k => $v) { + $total['current'] += $v['accumulated']; + } + + + //判断是否执行导出 + if (I('export') == 1) { + $this->exportSum($data); + } + $this->assign('meta_title', "充值汇总"); + $this->assign('list_data', $data); + $this->assign('total', $total); + $this->assign('startDate', $startDateTime); + $this->assign('endDate', $endDateTime); + + $this->m_title = '充值汇总'; + $this->assign('commonset', M('Kuaijieicon')->where(['url' => 'RechargeSum/summation', 'status' => 1])->find()); + + + $this->display(); + } + + public function exportSum($data) + { + $export = A('Export'); + $exptitle = $_REQUEST['xlsname']; + $expCellName = array( + array('date', '日期'), + array('promote_id', '渠道来源'), + array('game_id', '游戏名称'), + array('registerNum', '新增人数'), + array('livenNum', '活跃人数'), + array('newAddPay', "新增玩家付费"), + array('accumulated', '本日累计'), + ); + $expTableData = $data; + $export->exportExcel($exptitle, $expCellName, $expTableData); + } } diff --git a/Application/Admin/Controller/SpendController.class.php b/Application/Admin/Controller/SpendController.class.php index 4b20ab95c..1d24c85d9 100644 --- a/Application/Admin/Controller/SpendController.class.php +++ b/Application/Admin/Controller/SpendController.class.php @@ -48,9 +48,13 @@ class SpendController extends ThinkController unset($_REQUEST['server_name']); } if (isset($_REQUEST['pay_order_number'])) { - $map['pay_order_number'] = array('like', trim($_REQUEST['pay_order_number']) . '%'); + $map['pay_order_number'] = array('like', trim($_REQUEST['pay_order_number'])); unset($_REQUEST['pay_order_number']); } + if (isset($_REQUEST['extend'])) { + $map['extend'] = array('like', trim($_REQUEST['extend'])); + unset($_REQUEST['extend']); + } if (isset($_REQUEST['pay_status'])) { $map['pay_status'] = $_REQUEST['pay_status']; unset($_REQUEST['pay_status']); diff --git a/Application/Admin/Controller/access_data_foldline.txt b/Application/Admin/Controller/access_data_foldline.txt index 9c7c0eeec..ea73b15ce 100644 --- a/Application/Admin/Controller/access_data_foldline.txt +++ b/Application/Admin/Controller/access_data_foldline.txt @@ -1 +1 @@ -{"news":[{"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":3},{"time":"11:00","count":1},{"time":"12:00","count":0},{"time":"13:00","count":0},{"time":"14:00","count":0},{"time":"15:00","count":2},{"time":"16:00","count":0},{"time":"17:00","count":0},{"time":"18:00","count":1},{"time":"19:00","count":0},{"time":"20:00","count":0},{"time":"21:00","count":0},{"time":"22:00","count":0},{"time":"23:00","count":0}],"sum":{"news":7,"active":17,"player":3,"money":0.080000000000000002},"active":[{"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":4},{"time":"10:00","count":6},{"time":"11:00","count":1},{"time":"12:00","count":0},{"time":"13:00","count":0},{"time":"14:00","count":0},{"time":"15:00","count":4},{"time":"16:00","count":0},{"time":"17:00","count":0},{"time":"18:00","count":2},{"time":"19:00","count":0},{"time":"20:00","count":0},{"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":0},{"time":"14:00","count":0},{"time":"15:00","count":1},{"time":"16:00","count":2},{"time":"17:00","count":0},{"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":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":0},{"time":"14:00","count":0},{"time":"15:00","count":"0.04"},{"time":"16:00","count":"0.04"},{"time":"17:00","count":0},{"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":0}]} \ No newline at end of file +{"news":[{"time":"0:00","count":16},{"time":"1:00","count":11},{"time":"2:00","count":12},{"time":"3:00","count":8},{"time":"4:00","count":9},{"time":"5:00","count":5},{"time":"6:00","count":6},{"time":"7:00","count":15},{"time":"8:00","count":18},{"time":"9:00","count":28},{"time":"10:00","count":82},{"time":"11:00","count":77},{"time":"12:00","count":33},{"time":"13:00","count":36},{"time":"14:00","count":156},{"time":"15:00","count":136},{"time":"16:00","count":108},{"time":"17:00","count":71},{"time":"18:00","count":75},{"time":"19:00","count":99},{"time":"20:00","count":104},{"time":"21:00","count":82},{"time":"22:00","count":84},{"time":"23:00","count":45}],"sum":{"news":1316,"active":6633,"player":1359,"money":132537.03},"active":[{"time":"0:00","count":833},{"time":"1:00","count":294},{"time":"2:00","count":144},{"time":"3:00","count":101},{"time":"4:00","count":84},{"time":"5:00","count":150},{"time":"6:00","count":410},{"time":"7:00","count":590},{"time":"8:00","count":452},{"time":"9:00","count":438},{"time":"10:00","count":399},{"time":"11:00","count":299},{"time":"12:00","count":250},{"time":"13:00","count":174},{"time":"14:00","count":309},{"time":"15:00","count":269},{"time":"16:00","count":204},{"time":"17:00","count":174},{"time":"18:00","count":175},{"time":"19:00","count":222},{"time":"20:00","count":206},{"time":"21:00","count":161},{"time":"22:00","count":181},{"time":"23:00","count":114}],"player":[{"time":"0:00","count":174},{"time":"1:00","count":54},{"time":"2:00","count":34},{"time":"3:00","count":19},{"time":"4:00","count":17},{"time":"5:00","count":18},{"time":"6:00","count":31},{"time":"7:00","count":54},{"time":"8:00","count":54},{"time":"9:00","count":48},{"time":"10:00","count":53},{"time":"11:00","count":63},{"time":"12:00","count":45},{"time":"13:00","count":52},{"time":"14:00","count":40},{"time":"15:00","count":107},{"time":"16:00","count":90},{"time":"17:00","count":56},{"time":"18:00","count":47},{"time":"19:00","count":66},{"time":"20:00","count":62},{"time":"21:00","count":66},{"time":"22:00","count":66},{"time":"23:00","count":43}],"money":[{"time":"0:00","count":"21663.00"},{"time":"1:00","count":"3664.00"},{"time":"2:00","count":"2245.00"},{"time":"3:00","count":"734.00"},{"time":"4:00","count":"1526.00"},{"time":"5:00","count":"1506.00"},{"time":"6:00","count":"3141.00"},{"time":"7:00","count":"3900.00"},{"time":"8:00","count":"5225.00"},{"time":"9:00","count":"5350.02"},{"time":"10:00","count":"3657.00"},{"time":"11:00","count":"5008.00"},{"time":"12:00","count":"2899.00"},{"time":"13:00","count":"7167.00"},{"time":"14:00","count":"13457.00"},{"time":"15:00","count":"6680.00"},{"time":"16:00","count":"4772.00"},{"time":"17:00","count":"4365.01"},{"time":"18:00","count":"3683.00"},{"time":"19:00","count":"3187.00"},{"time":"20:00","count":"5599.00"},{"time":"21:00","count":"10597.00"},{"time":"22:00","count":"7201.00"},{"time":"23:00","count":"5311.00"}]} \ No newline at end of file diff --git a/Application/Admin/View/BindRechargeRecord/lists.html b/Application/Admin/View/BindRechargeRecord/lists.html index 86ff5acd1..f3d299cfd 100644 --- a/Application/Admin/View/BindRechargeRecord/lists.html +++ b/Application/Admin/View/BindRechargeRecord/lists.html @@ -46,7 +46,7 @@
- diff --git a/Application/Admin/View/Member/user_info.html b/Application/Admin/View/Member/user_info.html index 4f7d1b169..b91cb6357 100644 --- a/Application/Admin/View/Member/user_info.html +++ b/Application/Admin/View/Member/user_info.html @@ -69,10 +69,10 @@  
- +  - 
- +
diff --git a/Application/Admin/View/Promote/spend_list.html b/Application/Admin/View/Promote/spend_list.html index c0133f5a7..1f3e7e7d2 100644 --- a/Application/Admin/View/Promote/spend_list.html +++ b/Application/Admin/View/Promote/spend_list.html @@ -73,10 +73,10 @@ background-color: #FF9797;  
- +  - 
- +
diff --git a/Application/Admin/View/PromoteCoin/deduct.html b/Application/Admin/View/PromoteCoin/deduct.html index 3dad81fc5..c25e4db67 100644 --- a/Application/Admin/View/PromoteCoin/deduct.html +++ b/Application/Admin/View/PromoteCoin/deduct.html @@ -62,20 +62,18 @@ - 玩家账号: - - + 玩家账号: + + + + 账户余额: - coin_yuecoin_yue2" name="" value="" disabled="disabled" style="background: #e7e7e7"> + coin_yuecoin_yue2" name="" value="0.00" disabled="disabled" style="background: #e7e7e7"> @@ -130,7 +128,6 @@ $('#submit').click(function(){ $(function(){ $("#promote_id").select2(); - $("#user_id").select2(); $("#game_id").change(); $('.date').datetimepicker({ format: 'yyyy-mm-dd', @@ -147,6 +144,31 @@ $(function(){ }); +$('#user_account').change(function () { + var account = $(this).val(); + $.ajax({ + url:"{:U('getUserAccount')}", + type:'post', + dataType:'json', + data:{account:account}, + success:function(data){ + if (data.status == 1) { + var user = $('#user_id'); + user.val(data.user.id); + $(".coin_yue2").val(data.user.balance); + $('.user-account-msg').hide(); + } else { + var msgElement = $('.user-account-msg'); + msgElement.text(data.msg); + msgElement.show(); + } + }, + error:function (result) { + console.log(result); + } + }) +}); + /*获取游戏名称*/ $("#game_id").change(function() { $("#game_name").val($("#game_id option:selected").text()); @@ -157,11 +179,6 @@ $('#promote_id').change(function(){ $(".coin_yue").val($('#promote_id option:selected').attr('coin-yue')); }); - -$(".coin_yue2").val($('#user_id option:selected').attr('coin-yue')); -$('#user_id').change(function(){ - $(".coin_yue2").val($('#user_id option:selected').attr('coin-yue')); -}); function getDiscount() { $.ajax({ url:"{:U('Ajax/getGameDiscount')}", @@ -174,7 +191,5 @@ function getDiscount() { } }) } - - diff --git a/Application/Admin/View/RechargeSum/summation.html b/Application/Admin/View/RechargeSum/summation.html index aec2be1b2..3a971cb71 100644 --- a/Application/Admin/View/RechargeSum/summation.html +++ b/Application/Admin/View/RechargeSum/summation.html @@ -46,11 +46,11 @@
- -
-
@@ -81,8 +81,8 @@
- +
@@ -189,33 +189,28 @@ highlight_subnav('{:U('RechargeSum/summation')}'); $(function(){ //搜索功能 $("#search").click(function(){ - - var starttime = $.trim($('#time-start').val()); - var endtime = $.trim($('#time-end').val()); - - if((starttime && !endtime) || (!starttime && endtime)) {layer.msg('请完整时间搜索项');return false;} - if (starttime && endtime && starttime > endtime) {layer.msg('开始时间必须小于等于结束时间');return false;} - - - var url = $(this).attr('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; - } - var start = $("#time-start").val(); - var end = $("#time-end").val(); - if (start !='' && end != ''){ - if (Date.parse(start) > Date.parse(end)){ - layer.msg('开始时间必须小于等于结束时间'); - return false; - } - } - window.location.href = url; + var sdate = Date.parse($('#time-start').val()) / 1000; + var edate = Date.parse($('#time-end').val()) / 1000; + if (sdate > edate) { + layer.msg('开始时间必须小于等于结束时间'); + return false; + } + if ((edate - sdate) > 2592000) { + layer.msg('时间间隔不能超过31天,请重新选择日期'); + return false; + } + + var url = $(this).attr('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; }); $(".paixu").click(function(){ var that=$(this); @@ -348,7 +343,7 @@ $(function(){ }); $("#game_type").change(); - var game_server = "{:I('server_name')}"; + var game_server = "{:I('server_id')}"; $("#game_name").change(function(){ $.ajax({ url:"{:U('Ajax/getGmeServer')}", @@ -358,11 +353,11 @@ $(function(){ success:function(data){ str = ""; for (var i in data){ - str += "" + str += "" } - $("#server_name").empty(); - $("#server_name").append(str); - $("#server_name").select2(); + $("#server_id").empty(); + $("#server_id").append(str); + $("#server_id").select2(); } }) }); diff --git a/Application/Admin/View/Spend/lists.html b/Application/Admin/View/Spend/lists.html index f6ca733ea..946f352c2 100644 --- a/Application/Admin/View/Spend/lists.html +++ b/Application/Admin/View/Spend/lists.html @@ -47,6 +47,9 @@
+
+ +
@@ -62,7 +65,7 @@ - +