From e2a2a07f0353d59d1a361c9b17d2f7db0b02ea07 Mon Sep 17 00:00:00 2001 From: ELF <360197197@qq.com> Date: Thu, 21 Nov 2019 18:16:03 +0800 Subject: [PATCH 01/44] =?UTF-8?q?=E4=BF=AE=E6=94=B9bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controller/ConsoleController.class.php | 49 +++++++++++++++++++ .../Repository/PromoteRepository.class.php | 1 + .../Home/Controller/QueryController.class.php | 3 +- .../Home/View/default/Query/achievement.html | 2 +- 4 files changed, 52 insertions(+), 3 deletions(-) diff --git a/Application/Admin/Controller/ConsoleController.class.php b/Application/Admin/Controller/ConsoleController.class.php index 0e1010b0f..dcf6f6503 100644 --- a/Application/Admin/Controller/ConsoleController.class.php +++ b/Application/Admin/Controller/ConsoleController.class.php @@ -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; + } + } + } } diff --git a/Application/Base/Repository/PromoteRepository.class.php b/Application/Base/Repository/PromoteRepository.class.php index 867984aa7..83e40ea8b 100644 --- a/Application/Base/Repository/PromoteRepository.class.php +++ b/Application/Base/Repository/PromoteRepository.class.php @@ -370,6 +370,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 = []; diff --git a/Application/Home/Controller/QueryController.class.php b/Application/Home/Controller/QueryController.class.php index 255b4d206..753b1c416 100644 --- a/Application/Home/Controller/QueryController.class.php +++ b/Application/Home/Controller/QueryController.class.php @@ -2013,7 +2013,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 +2026,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'], diff --git a/Application/Home/View/default/Query/achievement.html b/Application/Home/View/default/Query/achievement.html index d37eaef80..8205bff9c 100644 --- a/Application/Home/View/default/Query/achievement.html +++ b/Application/Home/View/default/Query/achievement.html @@ -109,8 +109,8 @@ {$record.new_create_role_ip_count} {$record.login_user_count} - {$record.recharge_count} {$record.recharge_user_count} + {$record.recharge_count} {$record.recharge_amount} {$record.recharge_by_cash} {$record.recharge_by_coin} From 89b67c06a41e5760d2b251e1664f566f744452dc Mon Sep 17 00:00:00 2001 From: zhengyongxing Date: Thu, 21 Nov 2019 18:23:00 +0800 Subject: [PATCH 02/44] =?UTF-8?q?=E7=99=BB=E5=BD=95sdk=EF=BC=8C=E8=B7=B3?= =?UTF-8?q?=E8=BD=AC=E8=87=B3=E8=B4=AD=E4=B9=B0=E8=B6=85=E7=BA=A7=E7=AD=BE?= =?UTF-8?q?=EF=BC=8C=E6=97=A0=E9=9C=80=E9=87=8D=E6=96=B0=E7=99=BB=E9=99=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Mobile/Controller/SsgController.class.php | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/Application/Mobile/Controller/SsgController.class.php b/Application/Mobile/Controller/SsgController.class.php index 3691248f5..eb734bd4f 100644 --- a/Application/Mobile/Controller/SsgController.class.php +++ b/Application/Mobile/Controller/SsgController.class.php @@ -49,11 +49,19 @@ 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); @@ -62,6 +70,8 @@ class SsgController extends BaseController { $this->redirect("Ssg/login"); } + } else { + $this->redirect("Ssg/login"); } //获取客服qq From 7220083d8491ca68e19d9649e8007a5e8e937dea Mon Sep 17 00:00:00 2001 From: sunke <18850253506@163.com> Date: Thu, 21 Nov 2019 19:37:45 +0800 Subject: [PATCH 03/44] =?UTF-8?q?=E5=85=AC=E5=91=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Application/Home/Controller/ArticleController.class.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Application/Home/Controller/ArticleController.class.php b/Application/Home/Controller/ArticleController.class.php index 7c0e2af26..0ccce084d 100644 --- a/Application/Home/Controller/ArticleController.class.php +++ b/Application/Home/Controller/ArticleController.class.php @@ -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(); From feecf9199d3fb41687be7d2dc993e148eacd9437 Mon Sep 17 00:00:00 2001 From: yulingwei <2436953959@qq.com> Date: Thu, 21 Nov 2019 19:49:20 +0800 Subject: [PATCH 04/44] =?UTF-8?q?=E7=94=B5=E5=AD=90=E9=82=AE=E7=AE=B1?= =?UTF-8?q?=E6=94=B9=E4=B8=BA=E9=80=89=E5=A1=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Admin/Controller/access_data_foldline.txt | 2 +- .../Controller/PromoteController.class.php | 18 +++++++++--------- .../Home/View/default/Promote/edit_chlid.html | 2 +- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/Application/Admin/Controller/access_data_foldline.txt b/Application/Admin/Controller/access_data_foldline.txt index 49c9cc67d..bc484849f 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":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"}]} \ No newline at end of file +{"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}]} \ No newline at end of file diff --git a/Application/Home/Controller/PromoteController.class.php b/Application/Home/Controller/PromoteController.class.php index 1d0307c2a..ccfd6e84f 100644 --- a/Application/Home/Controller/PromoteController.class.php +++ b/Application/Home/Controller/PromoteController.class.php @@ -1132,15 +1132,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; - } - - $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)))); - }; + // 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)))); + // }; $user = new PromoteApi(); $res = $user->edit($_POST); diff --git a/Application/Home/View/default/Promote/edit_chlid.html b/Application/Home/View/default/Promote/edit_chlid.html index 2b078fa94..46df37f5f 100644 --- a/Application/Home/View/default/Promote/edit_chlid.html +++ b/Application/Home/View/default/Promote/edit_chlid.html @@ -97,7 +97,7 @@ - *电子邮箱 + 电子邮箱 From 1e090fc6dd07c639f700f03d0b4da4225828cccb Mon Sep 17 00:00:00 2001 From: sunke <18850253506@163.com> Date: Thu, 21 Nov 2019 19:50:19 +0800 Subject: [PATCH 05/44] =?UTF-8?q?=E6=97=B6=E9=97=B4=E6=A0=BC=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Application/Home/Controller/DownloadController.class.php | 6 ++++-- Application/Home/View/default/Query/register.html | 3 +-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Application/Home/Controller/DownloadController.class.php b/Application/Home/Controller/DownloadController.class.php index 76c7d09c2..2b1fe7df7 100644 --- a/Application/Home/Controller/DownloadController.class.php +++ b/Application/Home/Controller/DownloadController.class.php @@ -1738,8 +1738,8 @@ class DownloadController extends BaseController { array('promote_account','推广账号'), 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_'); @@ -1747,6 +1747,8 @@ class DownloadController extends BaseController { //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; } diff --git a/Application/Home/View/default/Query/register.html b/Application/Home/View/default/Query/register.html index 8943277f3..673eb850c 100644 --- a/Application/Home/View/default/Query/register.html +++ b/Application/Home/View/default/Query/register.html @@ -72,8 +72,7 @@
- +
From 1ed48003ac1ddebc903190a9ce486ed99f756e59 Mon Sep 17 00:00:00 2001 From: zhengchanglong Date: Thu, 21 Nov 2019 20:17:53 +0800 Subject: [PATCH 06/44] =?UTF-8?q?=E8=B6=85=E7=BA=A7=E7=AD=BE=E5=85=85?= =?UTF-8?q?=E5=80=BCBUG=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Application/Mobile/Controller/SsgController.class.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Application/Mobile/Controller/SsgController.class.php b/Application/Mobile/Controller/SsgController.class.php index 431040a6f..760e72a89 100644 --- a/Application/Mobile/Controller/SsgController.class.php +++ b/Application/Mobile/Controller/SsgController.class.php @@ -588,10 +588,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); @@ -623,7 +623,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']) From 49270427eefe1459bcb9d49a0c852a5de3144422 Mon Sep 17 00:00:00 2001 From: chenxiaojun <956334972@qq.com> Date: Thu, 21 Nov 2019 20:32:22 +0800 Subject: [PATCH 07/44] =?UTF-8?q?=E6=8E=A8=E5=B9=BF=E5=B9=B3=E5=8F=B0->?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E6=B1=87=E6=80=BB->=E5=85=85=E5=80=BC?= =?UTF-8?q?=E7=8E=A9=E5=AE=B6--=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controller/Notify3Controller.class.php | 1 + .../Home/Controller/QueryController.class.php | 210 ++++++++++-------- .../View/default/Query/userRecharges.html | 114 +++++++++- Data/update.sql | 22 ++ Public/static/icons_alibaba/iconfont.css | 24 +- Public/static/icons_alibaba/iconfont.eot | Bin 3256 -> 3452 bytes Public/static/icons_alibaba/iconfont.js | 2 +- Public/static/icons_alibaba/iconfont.svg | 9 + Public/static/icons_alibaba/iconfont.ttf | Bin 3088 -> 3284 bytes Public/static/icons_alibaba/iconfont.woff | Bin 1864 -> 1972 bytes Public/static/icons_alibaba/iconfont.woff2 | Bin 1364 -> 1476 bytes 11 files changed, 272 insertions(+), 110 deletions(-) diff --git a/Application/Callback/Controller/Notify3Controller.class.php b/Application/Callback/Controller/Notify3Controller.class.php index 6c3c0e9e6..33d7e65eb 100644 --- a/Application/Callback/Controller/Notify3Controller.class.php +++ b/Application/Callback/Controller/Notify3Controller.class.php @@ -194,6 +194,7 @@ class Notify3Controller extends BaseController $data['type'] = 1; $data['sub_type'] = 1; $data['target_id'] = $promote['id']; + $data['promote_id'] = $promote['id']; $data['target_level'] = $promote['level']; $data['target_type'] = 1; $data['ref_id'] = $order['id']; diff --git a/Application/Home/Controller/QueryController.class.php b/Application/Home/Controller/QueryController.class.php index 255b4d206..2529f6bd4 100644 --- a/Application/Home/Controller/QueryController.class.php +++ b/Application/Home/Controller/QueryController.class.php @@ -1709,118 +1709,132 @@ class QueryController extends BaseController $isSelf = I('is_self', 0); $roleName = I('role_name', ''); $userAccount = I('user_account', ''); - $promoteId = I('promote_id', 0); $sdkVersion = I('sdk_version', 0); $costBegin = I('cost_begin', ''); $costEnd = I('cost_end', ''); + $sortName = trim(I('sort_name', '')); + $sort = intval(I('sort', 1)); + $nowTime = date('Y-m-d'); + $initBegTime = date('Y-m-d', strtotime('-6 day', strtotime($nowTime))); + $initBegTime = empty(I('begtime')) ? $initBegTime : I('begtime'); + $initEndTime = $nowTime; + $initEndTime = empty(I('endtime')) ? $initEndTime : I('endtime'); + $begTime = strtotime($initBegTime); + $endTime = strtotime($initEndTime); + $endTime += 3600 * 24; $promote = $this->getLoginPromote(); $levelPromote = $this->getLevelPromote(); $queryPromote = $this->getQueryPromote($levelPromote); - $map[] = [ - '_logic' => 'or', - 'id' => $queryPromote['id'], - 'chain' => ['like', $queryPromote['chain'] . $queryPromote['id'] . '/%'] - ]; - $ids = M('promote', 'tab_')->where($map)->getField('id', true); + $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]]; + if ($costBegin != '' || $costEnd != '') { + $having = ''; + if ($costBegin != '' && $costEnd != '') { + $having = 'sum(recharge_cost) between ' . $costBegin . ' and ' . $costEnd; + } elseif ($costBegin != '' && $costEnd == '') { + $having = 'sum(recharge_cost) >= ' . $costBegin; + } elseif ($costBegin == '' && $costEnd != '') { + $having = 'sum(recharge_cost) <= ' . $costEnd; + } + $subQuery = M('user_play_data_count', 'tab_')->field('role_id') + ->where($subMap) + ->group('game_id,server_id,role_id') + ->having($having) + ->buildSql(); + $map['_string'] = 'role_id in (' . $subQuery . ')'; + } + $spendMap['uc.create_time'] = ['between', [$begTime, $endTime - 1]]; + $spendMap['_string'] = 'uc.game_id = game_id and uc.server_id = server_id and uc.role_id = role_id'; + $sqlCost = M('user_play_data_count', 'tab_')->alias('uc') + ->field('sum(uc.recharge_cost) cost') + ->where($spendMap) + ->buildSql(); + $sqlCount = M('user_play_data_count', 'tab_')->alias('uc') + ->field('sum(uc.recharge_count) count') + ->where($spendMap) + ->buildSql(); + $spendMap['uc.create_time'] = ['between', [strtotime(date('Y-m-d 00:00:00')), strtotime(date('Y-m-d 23:59:59'))]]; + $sqlTodayCost = M('user_play_data_count', 'tab_')->alias('uc') + ->field('sum(uc.recharge_count) count') + ->where($spendMap) + ->buildSql(); + $query = M('user_play_info', 'tab_') + ->field("*,$sqlCost as cost,$sqlCount as count,$sqlTodayCost as today_cost") + ->where($map) + ->order('play_time desc'); + list($roles, $pagination, $count) = $this->paginate($query); - $records = []; - foreach ($roles as $role) { - $records[] = [ - 'user_account' => encryption($role['user_account']), - 'game_name' => $role['game_name'], - 'role_name' => $role['role_name'], - 'role_id' => $role['role_id'], - 'role_level' => $role['role_level'], - 'server_id' => $role['server_id'], - 'server_name' => $role['server_name'], - 'recharge_cost' => isset($allRecords[$role['role_id']]) ? round(floatval($allRecords[$role['role_id']]['cost']), 2) : 0, - 'recharge_count' => isset($allRecords[$role['role_id']]) ? $allRecords[$role['role_id']]['count'] : 0, - 'recharge_cost_today' => isset($todayRecords[$role['role_id']]) ? round(floatval($todayRecords[$role['role_id']]['cost']), 2) : 0, - 'play_time' => $role['play_time'], - 'play_ip' => $role['play_ip'], - 'promote_id' => $role['promote_id'], - 'promote_account' => $role['promote_account'], - 'sdk_version' => $role['sdk_version'], - 'unlogin_day' => intval((strtotime(date('Y-m-d 00:00:00')) - strtotime(date('Y-m-d 00:00:00', $role['play_time']))) / (24 * 3600)) - ]; + foreach ($roles as $role) { + $records[] = [ + 'user_account' => encryption($role['user_account']), + 'game_name' => $role['game_name'], + 'role_name' => $role['role_name'], + 'role_id' => $role['role_id'], + 'role_level' => $role['role_level'], + 'server_id' => $role['server_id'], + 'server_name' => $role['server_name'], + 'recharge_cost' => $role['cost'], + 'recharge_count' => $role['count'], + 'recharge_cost_today' => $role['cost_today'], + 'play_time' => $role['play_time'], + 'play_ip' => $role['play_ip'], + 'promote_id' => $role['promote_id'], + 'promote_account' => $role['promote_account'], + 'sdk_version' => $role['sdk_version'], + 'unlogin_day' => intval((strtotime(date('Y-m-d 00:00:00')) - strtotime(date('Y-m-d 00:00:00', $role['play_time']))) / (24 * 3600)) + ]; + } } $games = $this->getGamesByPromote($promote); $this->assign('games', $games); - $this->assign('promotes', $promotes); - $this->assign('groupPromotes', $groupPromotes); $this->assign('records', $records); $this->assign('pagination', $pagination); $this->assign('count', $count); + $this->assign('initBegTime', $initBegTime); + $this->assign('initEndTime', $initEndTime); $this->display('userRecharges'); } @@ -1906,10 +1920,10 @@ class QueryController extends BaseController public function achievement() { $time = I('time', date('Y-m-d')); - if(!empty($time)) { - $defaultTime = $time ; - }else { - $defaultTime = date('Y-m-d',time()); + if (!empty($time)) { + $defaultTime = $time; + } else { + $defaultTime = date('Y-m-d', time()); } $sdkVersion = I('sdk_version', 0); $gameId = I('game_id', 0); @@ -2000,7 +2014,7 @@ class QueryController extends BaseController $rechargeCountList = $promoteRepository->getRechargeCountByIds($ids, $params); $rechargeUserCountList = $promoteRepository->getRechargeUserCountByIds($ids, $params); $rechargeAmountList = $promoteRepository->getRechargeAmountByIds($ids, $params); - + if (I('p', 1) == 1) { $selfParams = $params; $selfParams['isContainSubs'] = false; @@ -2013,7 +2027,7 @@ class QueryController extends BaseController $selfRechargeCountList = $promoteRepository->getRechargeCountByIds([$parent['id']], $selfParams); $selfRechargeUserCountList = $promoteRepository->getRechargeUserCountByIds([$parent['id']], $selfParams); $selfRechargeAmountList = $promoteRepository->getRechargeAmountByIds([$parent['id']], $selfParams); - + $records[] = [ 'id' => $parent['id'], 'account' => $parent['account'], @@ -2070,7 +2084,7 @@ class QueryController extends BaseController $this->assign('parentid', $parentId); $this->assign('count', $count); $this->assign('timeout', $timeout); - $this->assign('time',$defaultTime); + $this->assign('time', $defaultTime); $this->display(); } diff --git a/Application/Home/View/default/Query/userRecharges.html b/Application/Home/View/default/Query/userRecharges.html index 29dd264db..06dce4616 100644 --- a/Application/Home/View/default/Query/userRecharges.html +++ b/Application/Home/View/default/Query/userRecharges.html @@ -1,6 +1,7 @@ + @@ -60,7 +71,19 @@
+
+ +
+ +
+ +
+ +
+
+ +
@@ -77,10 +100,50 @@ 游戏区服 角色名 等级 - 充值总额 - 充值次数 - 今日充值 - 未登录天数 + 充值总额 + + + + + + + + + + + 充值次数 + + + + + + + + + + + 今日充值 + + + + + + + + + + + 未登录天数 + + + + + + + + + + 最后登录时间 组长|推广员 @@ -124,11 +187,41 @@
+ + + + \ No newline at end of file diff --git a/Data/update.sql b/Data/update.sql index d7e073da5..3f970464b 100644 --- a/Data/update.sql +++ b/Data/update.sql @@ -458,3 +458,25 @@ ALTER TABLE `tab_promote` --提现订单 添加索引 ALTER TABLE `tab_withdraw` ADD INDEX `widthdraw_number`(`widthdraw_number`); + +--玩家角色数据统计表 +CREATE TABLE `tab_user_play_data_count` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `game_id` int(11) NOT NULL DEFAULT '0' COMMENT '游戏id', + `server_id` varchar(255) NOT NULL COMMENT '区服id', + `role_id` varchar(255) NOT NULL COMMENT '角色id', + `recharge_cost` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT '充值总额', + `recharge_count` int(10) NOT NULL DEFAULT '0' COMMENT '充值次数', + `create_time` int(10) NOT NULL DEFAULT '0' COMMENT '创建时间', + PRIMARY KEY (`id`), + KEY `recharge_cost` (`recharge_cost`) USING BTREE, + KEY `recharge_count` (`recharge_count`) USING BTREE, + KEY `search` (`game_id`,`server_id`,`role_id`) USING BTREE, + KEY `create_time` (`create_time`) USING BTREE +) ENGINE=InnoDB AUTO_INCREMENT=0 DEFAULT CHARSET=utf8; + +ALTER TABLE `tab_user_play_data_count` +ADD INDEX `search`(`game_id`, `server_id`, `role_id`) USING BTREE, +ADD INDEX `create_time`(`create_time`) USING BTREE; +ADD INDEX `recharge_cost`(`recharge_cost`) USING BTREE, +ADD INDEX `recharge_count`(`recharge_count`) USING BTREE; \ No newline at end of file diff --git a/Public/static/icons_alibaba/iconfont.css b/Public/static/icons_alibaba/iconfont.css index 9cce5fc11..4f48a8e51 100644 --- a/Public/static/icons_alibaba/iconfont.css +++ b/Public/static/icons_alibaba/iconfont.css @@ -1,10 +1,10 @@ @font-face {font-family: "iconfont"; - src: url('iconfont.eot?t=1570870899994'); /* IE9 */ - src: url('iconfont.eot?t=1570870899994#iefix') format('embedded-opentype'), /* IE6-IE8 */ - url('data:application/x-font-woff2;charset=utf-8;base64,d09GMgABAAAAAAVUAAsAAAAADBAAAAUEAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHEIGVgCELAqJGIcgATYCJAMwCxoABCAFhG0HgTsbNQoRFaSZkH1xwJv6gmNIQk1g8ltlso971mEXikzzP0cQrensPSQpkwKU8QWyZWFI1YgIV0Blqmt0hfkvGJGDPGvSVAtI7QFI1ta9YAQAooxJVvi6bJlrytZHmJvybZefHrjA5ZkN4df/jbk69ZD0T6+tl7uJKuKeeDSWiJJ4hCTi2TIhWgiRh23BdhULqzD7pQ8T6LFAGbJv6+wNVDlxVCDujtIjgBqKyDOkoekviQtziAcgaaYUwjqAe/vv4x80gwqSIgPxqGOaTTSYP4MXaij2vwPBaBxgzaVwu4wMm0BOfJCZJ0Dd5k2onk9nolsAQ/KGKBXyTOaZ8XOJ5/jzohdq//9X4JKOUcUZhZNRPwzhxE3lvS8/kMmVCr1C0tDU6uSfV4Lw9CHzpaWXCrR12a2IyKmkESWVDKKgMkb0UosjgloCkahxgll1ISKa1EWIFj9qy/UM6fApYAzEEUB8Mua5K0lm0LNiSENCl5+Tk0tYmDnJThRWX5SRmfMq6+CuKKlqT49tYEeEWL59KbUZiJ0WJra0NoSEtzJeZ+3fFiZW7OiwDe2JkSp3/f0hn5s7P5WXt5DXtxBva+Dx8StKayk5SaMX4a2p3NH5PGxQTEFaGx5Bp2W50gIh7oKkQamt+PXoZkyBTpXhvJdGPnpRaWO2JLUZ6x6dj7Wk8dFL+XjrGXqeESnkZcznBi0r4GGSFfEhJxQG7u97Hxz43Lnjd3h4Rbl8HRIs7+/TWTLCvMyFVzjPOo2NwawkNnoDi3kbn7boUceR6Bgk7aHP4bOg9yDvw8OzvlN3kA6tPbgs7Y6ZjzaIdzAfKkb1wewtm/+xcrBiuiq0s+zX53j/L5rimh7MHpIaErfwFEFNrJh29OXrYgFJBhhrJgsSHyBQXFbWKirWZnYrFtASgDcUpUQkmMxNFjxL+ery2NwR8ysTw5d5P/DsrRscGZ9tvfUM/g/VVI+JXZIYra6R2NmULtFWUx3bAYaqiovJ4erhZI71anVyeGjAZPUE8c8f4oTEJjEc/gCmx2oV6M4Ois4KTtDBK2AXdqYOC0+pdj6Y/ESd1LmTLUj2TNubSfGGDPf3GTXyJl8PNPOPlsk+k7oIU1OEE1lZJwiATWI4/J3nlDY3FaVp+oSk/v4kdBJ4lJDEivo06Vr6+3B7G4Du/VSj4rZyukRRC35mFRjhBxrXXIo+Q2kUli5zXP8h2Sg7r/uZJPTcOEgV3/s+jM34K5XpeFnzvTR0npW7GBGa66EpUdh6JlgLLsi/dhHty99zo0cK9Gk7jRoTemSB7r8w4l4XvvHCvQlN4z4kDfOQaVqk5sxNKPRqQ6lpC3pssLu816hzgIqcAViXABCGdEEy4AsyQzaoOfMuFCa8hdJQoNDjEuG6Ya9lfNDDK6MSXEAfgUxOVsXlwen7ha4FxUG7Lf9DrlQHUz9G2z4xITdxSt25WcSC5RzhAx6HIWQonLdopF9FymYYLPVGvcnx7MEroxJcgD4CMjlZs7o8xH7/C10LijOm/Jj+IVfaPpj0xgLUT08qNOVQBtedmwlrtMDeeucIPlgKg2zOoND7bdFIb63QWDYGtpQt6um798U9bj+8phGfzhwlumFatuN6Pn97vlXJHSi5PdKhqXRac3IvCY5Ho6UQbt4Hro1uHSa3tHz7S003LsctND2W0GpniE3Ap0jp06P+N8WYaH05r1W5hOP91nftBKucnQEAAAA=') format('woff2'), - url('iconfont.woff?t=1570870899994') format('woff'), - url('iconfont.ttf?t=1570870899994') format('truetype'), /* chrome, firefox, opera, Safari, Android, iOS 4.2+ */ - url('iconfont.svg?t=1570870899994#iconfont') format('svg'); /* iOS 4.1- */ + src: url('iconfont.eot?t=1574318572037'); /* IE9 */ + src: url('iconfont.eot?t=1574318572037#iefix') format('embedded-opentype'), /* IE6-IE8 */ + url('data:application/x-font-woff2;charset=utf-8;base64,d09GMgABAAAAAAXEAAsAAAAADNQAAAV3AAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHEIGVgCEXgqJfIdpATYCJAM8CyAABCAFhG0HgVgb2QrIDiUFOVaVJ6RZZvD85191X1W1MLCyWTi1uxfA72xhR8yYA/oz62izPfv/9736O9OFkN1HsdMmabbwgp1H8tfnH9TVfr/6xRANSRdv9HL3RO8YFhWLNH5CPDGEJOKRoTOEaClFTMKz10xIKn+FiY9DAD/5NMbXu+/g0RCBgY8TQGZOozxExNIwBSGCN9mtuNQgW3HhVevULWCL+/fyg2aJAIVLw0/qH+sjQnebzt7aczxG65lY3eUAi6tAA7UABuS0Mu8oaL+uFg7/7n0MCwGSSYBD2WKX2e0dRR2JV2tfN+vs7ThgY5emrYXWNbaeo3FLIZkU0sSaYc36Bx6gMbhxEUZQePDiw0+AICEQNzCD5LxRHwYbMxEabEEMWCkQN1gZEBdYOxIRho7CRAh0FCEKLAHEA7YbiBdsDxLhg86GRPihsycSAOsFJAjWG30IARCxL8kHyARkECAPYD7T1ZU4xa65pFJUlGJnJien5OYGs6Mmx8Aoja8ZTF4Wd+ZRnmvr43aR0w9zzaYHxevPgrHORcdvuOALTZyPqgifepBjNj9sEzn7ON+15dH44bAqJXXngrT03WlD1yQO7k4dMm7thv3r1RhdmziwIGXyqjTpMWX1hoNBPk6K9IURTN2V1WP9gWDF5H1WA3XOxmDarCY9vnb/nuLg9fu8tuIqa//C9HgtntZO7wVRvt3p/lWpmKGrUwOhazPklDUjnzwZ/fTpmOfPxz17VmroYz0aLX3yhIYKUtODleeww+exeXI4NBLvYGZ652NWfe4MEaf4Fn4c88yeFMcgxqZhWkHESX31GP3smTn06nPf4NJortrwvNuQ1oAsb4zX846x3G3P/g8nhj3TK7Tq4rdvG+woaS5sHhAzorhF0erguqxmax2Z9ubHusxiH6R65zFNd8vau3HjgbyCC3abdZktWbxXWdYHZq/1mZd1XuNJJRfvSt1LL98oSf+cVuLcQrp050C1jXP22LaL+YsLLmzbLsTbMl5wcPu21C5wfeu6dWHTG6eHETHnN3dPj3W7cvRyyP//5rIQm1pq2C3wrOEQd/8hB20zUahUBv3GGW2IlNP08uOzH25mtz3fyrR4vP2Np3r1puF/Nm2X/X88bbmTHSi3SxZBt5tseFYadIuUQTvXlgTVfmXLFoU0NadQw91vNrp3r2FprL1/7pVTc6EpSvfP1Yvbx2rvUH8f1rwDcB7poxq5EddUvu7hp++Ee+o3N7Nug36pYyoiends/KyX6QTSPVRbAAhQ3XULlX/0XP3LOgxx8idOi+/81xv9Z1vw8t/I91TqeAaGaYcXBZWl35FUcZrZK5weMdvJN49AgAitcJ+YHPBLEThUlMzD4Xha5Y4geEkLQeEhDzReSq3GWQsuArSCGy/dwE8N/a4OkIIFhxgfUM1sDYQoR0ER5iZooty2GucDcJHOB3ATFQ78DJXkWwYoF+bvNR/zDhZRoAwxQdeIkelEeZ1HYuoqvBVV3LCx2LJZJWpR35hs7Ic1bHVxhl1MWzoOQcTSVdRXexpWFB0Zll6EBaep5DhGx2YNMdUHNRV0FaLohQWGxwEjgghQBoIhoKNBbO8OUanfHwmG4qLAYxWMuks6FoyFDds5ogVNaV7B2s/UKo06lZ42xVBa4ug1BARZdNRRQfTVczCK1OkgDPVBRWAEHJoiNagx6EgzfTZS1Ww6PFcf9xWAH/6kiCjRYsQlbvGIV3zil4AEJSRhiUiUlBiv0VKm0RLMSl1eK5d0jaZmqKsawhQlbHuo5LJwOkWjoquHH3JahNESdwiwaGOmazcRmCUoOEadpu3a2abLWzhT2mihRm9DKQux51hOpNWmiaiXaOF+rmtEPhitmzjYdgAA') format('woff2'), + url('iconfont.woff?t=1574318572037') format('woff'), + url('iconfont.ttf?t=1574318572037') format('truetype'), /* chrome, firefox, opera, Safari, Android, iOS 4.2+ */ + url('iconfont.svg?t=1574318572037#iconfont') format('svg'); /* iOS 4.1- */ } .iconfont { @@ -55,6 +55,18 @@ content: "\e82f"; } +.iconsort:before { + content: "\e842"; +} + +.iconsort-down:before { + content: "\e843"; +} + +.iconsort-up:before { + content: "\e844"; +} + .iconicon-test:before { content: "\e63c"; } diff --git a/Public/static/icons_alibaba/iconfont.eot b/Public/static/icons_alibaba/iconfont.eot index e738345bf7e8180b538ef30c17979a70c3d8abc8..fc5f6ff132259ed70e9510b6313dcf0f0438a903 100644 GIT binary patch delta 638 zcmZ8ezi-n}5dQAjX>gM`DTOwT5DIF;)CyR_uMoMx17buK5(|};1cFq@7I8&Efrfzz zhEx`?0z)OFPR-JRArs;c=uj5KFIBKT>F(#Y%mf3 zB5@8M7;_ENSu1hCdb@m;R;;R_Y>$8EUYp-}(^#|V1T@ZP!*|m#>*b}~@G+pg;DM%X zwH&W@%Ja!Xpz%BGoHPDN=S0RaAFLzD%mym9Oi51qi`) z@UI?#JK*aF0ROe<6w$^ze8NvUO^;}s0x>1##U*h~Jn8+C&&kUjsV{XP_zN(p&~b${ z>QjHH4G(=M3|K1MDx|*9xHhbe(jqGRmkV`JP)LgUBbi=a`6GDMCzIJRQYlRtx0qa= em0Q+*M+vWmn)RR=kD^suxmUHC3r@YoyWR&~N|xCG delta 484 zcmX|7JxE(o6#mY8_r2uhy`b0@)jilA^fX;2}vFbV8 zJlmdpy^#TA4ZzD>;8$L34YmM75d-s!D}`r?FTVlxoTwM`{#;^rFJ$fsF;*lIIX2%g z{zhbqL2Y@M0rmcH8(u8u{K%F)%Gx%a3jF1YBr(bRZl2R6KgdsHQjKf diff --git a/Public/static/icons_alibaba/iconfont.js b/Public/static/icons_alibaba/iconfont.js index ca21a83cc..9c02c96ce 100644 --- a/Public/static/icons_alibaba/iconfont.js +++ b/Public/static/icons_alibaba/iconfont.js @@ -1 +1 @@ -!function(a){var t,c='',e=(t=document.getElementsByTagName("script"))[t.length-1].getAttribute("data-injectcss");if(e&&!a.__iconfont__svg__cssinject__){a.__iconfont__svg__cssinject__=!0;try{document.write("")}catch(t){console&&console.log(t)}}!function(t){if(document.addEventListener)if(~["complete","loaded","interactive"].indexOf(document.readyState))setTimeout(t,0);else{var e=function(){document.removeEventListener("DOMContentLoaded",e,!1),t()};document.addEventListener("DOMContentLoaded",e,!1)}else document.attachEvent&&(o=t,n=a.document,i=!1,(l=function(){try{n.documentElement.doScroll("left")}catch(t){return void setTimeout(l,50)}c()})(),n.onreadystatechange=function(){"complete"==n.readyState&&(n.onreadystatechange=null,c())});function c(){i||(i=!0,o())}var o,n,i,l}(function(){var t,e;(t=document.createElement("div")).innerHTML=c,c=null,(e=t.getElementsByTagName("svg")[0])&&(e.setAttribute("aria-hidden","true"),e.style.position="absolute",e.style.width=0,e.style.height=0,e.style.overflow="hidden",function(t,e){e.firstChild?function(t,e){e.parentNode.insertBefore(t,e)}(t,e.firstChild):e.appendChild(t)}(e,document.body))})}(window); \ No newline at end of file +!function(a){var t,o='',e=(t=document.getElementsByTagName("script"))[t.length-1].getAttribute("data-injectcss");if(e&&!a.__iconfont__svg__cssinject__){a.__iconfont__svg__cssinject__=!0;try{document.write("")}catch(t){console&&console.log(t)}}!function(t){if(document.addEventListener)if(~["complete","loaded","interactive"].indexOf(document.readyState))setTimeout(t,0);else{var e=function(){document.removeEventListener("DOMContentLoaded",e,!1),t()};document.addEventListener("DOMContentLoaded",e,!1)}else document.attachEvent&&(c=t,i=a.document,l=!1,(n=function(){try{i.documentElement.doScroll("left")}catch(t){return void setTimeout(n,50)}o()})(),i.onreadystatechange=function(){"complete"==i.readyState&&(i.onreadystatechange=null,o())});function o(){l||(l=!0,c())}var c,i,l,n}(function(){var t,e;(t=document.createElement("div")).innerHTML=o,o=null,(e=t.getElementsByTagName("svg")[0])&&(e.setAttribute("aria-hidden","true"),e.style.position="absolute",e.style.width=0,e.style.height=0,e.style.overflow="hidden",function(t,e){e.firstChild?function(t,e){e.parentNode.insertBefore(t,e)}(t,e.firstChild):e.appendChild(t)}(e,document.body))})}(window); \ No newline at end of file diff --git a/Public/static/icons_alibaba/iconfont.svg b/Public/static/icons_alibaba/iconfont.svg index 3a3f91969..e098e00a7 100644 --- a/Public/static/icons_alibaba/iconfont.svg +++ b/Public/static/icons_alibaba/iconfont.svg @@ -50,6 +50,15 @@ Created by iconfont + + + + + + + + + diff --git a/Public/static/icons_alibaba/iconfont.ttf b/Public/static/icons_alibaba/iconfont.ttf index fe69cbe053b50bcd7b5df041f5912714a64d583c..552caa9fc48f630df727f9f3ec9851dbe1de4642 100644 GIT binary patch delta 654 zcmZ8dO=}ZT6g~INB$G+fOl;MrMQlsbU5j-ie#9DT79y@h1YKA{5{=M&U{Z{rHX`ms zB7?fMn}Xm%?8ZeG`4L^zjdV2`#jU%Tc;2)q_#WrI`_8@R+{f*vcBi`OjdOrJ25_@j zEi_(W`4*s(#GQL)`s&fA^?k!g$Vi1WL19TIaYYWmEEQkJy*EYpRKjtsn!u zhY>^zyrV4Nf{7M2<4BTGo_O=p^7Eq+;K9p~nuvYdEe_T|tr;eIqONW%4vs~LX<(4YwZ z=sz(K* zr*e9DtPIjBDEph!KA5+~2=sx?c02N0%{ZdO5K}@D7E2;xOH^VKmoZ6*BT4sFY&~r@ c>knGCJ{C*$hczpR)*JTyV!gK5DmOXzKSXDc(f|Me delta 437 zcmYLFJx>Bb5S_g{f#dEXQG-BXAV3EJEo{V(LK|ach^@IGhzSQo&IA(;8m&l7&@)Qw zA20@DETpi~(uT&ySeV038;zCt4vo&_?aaQNw==tKZ_QH+RzgHWcfkVWRd47|(*RKk^62TRE$>Q+}Fku&lOUty=ohS z)}noyS}rm#&EVXFy+5yN>8YgeYn#aNjD}jVP|^c)ib5nMQE+|O3Qo(!kOCk3jo0P= z#5+kC4)$<&Rr-(J9f9~g>>b2eEX>l$#t1uOG2@2K8ZK_IQtz=uN5uEC2%;0EbrL9p zdKa80GMO1R6P-Y3w{!Xu>vqAA83N-6bMnJjE&hx_H$X#hH{5z1j~i{&M-uvQWXD`0 zIhz-p!o=fWnPlAZ6HGEVVcu95hIxE)vnGrR&9L~%F^n#IjD)oXX)Q&WH%PT}4N!g#XyZ4;W_ul(CpL0L=`^SBz(5R@E@+p!MKp+nI2zRJLO@Bsli<-9iOCShhI&N^PEOE6kEQPG@}bgTAF}la78sOd$kz_h z2oZ<&NtiBhjiE3iA>lBzkUM0~aQ6R}8W)?82yMM@Pyj(R8-Xw2%fP}}ag>DBk#NAOe2~k=^;!hADa)B ztMXHx+;Oiq)6{{)A|?VOt(0q#3EN_4Jk6*s{v@;L!Hs|aEe&6A6MMK~vw3A#salw0 zY`{woBGw9CS8l53Y_Lw2+=!m#REepm%RM;)YxMoDEIoTtUF7k#gq}TjhuV8XF#^8b zFfRV;qwhE!OgB%0Uf~;I&~5F7yF>DWdTrKo;Bu@Gx!qA_AyaV2#mGjg)U8Q-=cQ0b z)CM~d>I4TMxg_-mZ<^|HwOjW5rKmjK#o~yE9(BE@iGTZ%q)c3j^-ui4_k`QB2Kw9V z$F^o$V`WXIxACKqfmUu-Y{>z*=nbN>h)<>+ODoA6R!QkaJE+&vX95RmeH_7{%|`TA z3Z0H7F20QNarWuMq&R6LEaF`ZSqUTTG;N8~1bx-djc^Rf+_-Eys-yGa(wugsL$?RE zo4I#GGQc&{9NiwXe!{$EmxU|IlIXk0ymV(WH%__0H*2Ld&Ozbw43aC5bxvz;oJTz- z*|gY73+OZcr{uap>szZwD|JiA+_LRq9BP|?*9x@zT&5sBsD%3o8_n=M>Uv!*if zl`WZ!cUZGqEpEo$+jw;_=)vxE$GrdSo7T2z;oH=@?nftcY(InitNSoVv zE8x0Ll;kEQY`Gi0#QZ{FX{D1p9{H0!{W&Z0y}Iq;YccuLan+>F~1l%d|2c%@0h+nK7fznFe!gWi5+n^EJgAHeX@2Q+HpOzFjrLuWOl% zB|VNln~)Zp-p>o1K3K`dpQ@PHC7icH^CwN}(S0@=ke8Hp`v%uL% zRk`LBPkzT-Y3liyEq;>c{!H6xgwF{ARk;VuyEVUmQKiFp9UQ{28hZJA>8_fiNQ5QR z-WNu*9E8iCg<1BcH)n8TnHSB+3|RoVuHX-yYjO#d96=_7@Q%GT-;cX?VcJcBTCU@> zx6ABhc32Wfi3Dq2Uq`#73IaIYKqmaJ|M#*x0o*k&7pA@{0ZyvJlc8A@GMQ|sDgmTh z03MnSg&nvI_#Ox)Q#9NGPJ;jPpW%2khC+@4FjIqBxSQ0~J+iX|P{hJQ8ZIHcVJvTz zbc|ZYL4>(W77{OornoqkG+E{MU@C+4ZWM^cix_3G}!_ugWWKc)QlEWQX zig(Q{$6l~qbQ!EIrs1$t2;X}VBohDGJ{_)14 t*^j@Z_)}zX`mf0PxeZhKZMEknfw&ZcnyfUdww5da8tZ~jghgLOF==4LP+0-%^_t5?;<459_X{4MO; z1%s$}zx*8&76DK~!@U6vW94CmWF|YD3u}0|*MxyzC#+EVy3Zb_`s+~UBMEF87tSRr zorHz0FtE@@U>`zb2f@Z@_(9HaID7w5c?>7?VmJWE7T6ODqt4J-T|I3B6u|3dge;FV zqM8TWy8${_@hJpGC)F_AtWPOD>aq4H%DAGJSd)HZMn`*jcOLYiO!EXDS;Dzx!I^rp zHHx!mI#p2Df!htL0U^wkj2hmMxFFI`&B=3%ys12GN?h}Q(1{F-m)9KN1;t18x`$wq5;l|zeP zsdIbpCI`u@g4`w9LA=tkd8Ts4>D*P2(rMYl&5AkV&eU;0=j^E%5*mw!aQ$p=R=LVh z723PsSg?gsoECzx<_+A=t{GYChzeCPdAn>o5JV=pmB*|3IdkS!4_DzD``&=dx^I))c>Hr|Lf#TPY>yyN_%#Fjy7$cYc=(v_DlTgy)hKxm;riogn3`@ z^+v3TW?YsK+B99x2+aHNP=|A9PHvf!X)FoEl?|LAZ1$7$3=W!J8MCP!IxJ88()PDm z>lY8>G{7Fap3#P?2ahTz6zg2W_f;WJ_jm5V3d&UyCezRIOPx+}=331Py`(oqY5IM6 zH?8y=Hf>3oaUPt$P&RIBF+a5}IRHx=wrKV(np*IM>MzOZyYISTs)$q$lBmZr0 zV!Jwx3UaLni}eVXIz3c`zXnMH9!M|&cXY4CNHOOdK$Q41K6-XVe4(f{c3-8`;2c>L z|N0vL6FShuB!QOEA}iLlWF@ppUee!}%}T>b;vk;E#4A0sakSJM{GRr{;*Oow+dWQ$ zL#H;?q3AE8w7_DSW6HLlBR@_;27$tx`3H%d+5AuY<+ z?Z;am6y5i=_Ae=`eMyC$-TKsIyjLnEQ4=fv>18t`mQX8##rav*Ur8iCW}2OpxL^n` z7B`Dd4Wv@R>(HHoVaeP;bkJxp4e+iCBsCbLi8Xa|we}8s3uOfzS2T!lRJ-`!g>OsP z1Q7PADUhxVfCJiy2zVHcN~Ib?3P1@3EaCBR5kWM_2W>zG;h;#U99l)_A>95C9;M-F z)L;PNucOeg&X0j(|>7^eVYSJh4U-7DeelC$8r9c1?&q9Yq7~oV$ku7A8#$ zBf~uAhHo$_?z`j%oD}v-om92a2Dx!tklh^gA5ZZiEz9ARLCw=-e9q%p25$DW-d=|H z#P^}(B0eT*EWD65Lr%`fU+@@7QWYH__B_v9B-XY*wkf|Vd0yy~s9Cy(KLvlC{{pQE BM{fWC diff --git a/Public/static/icons_alibaba/iconfont.woff2 b/Public/static/icons_alibaba/iconfont.woff2 index c3d731404e1019decf024f38f6df048acc09b6a6..649a6d02f4eee8676b6f132e51294f8476b1bd7c 100644 GIT binary patch delta 1466 zcmV;r1x5PQ3d9Q-cTYw#00961000HV01E&B000cs000Gdkr*C-UJ8kPhiL&e0we=G z3m^alAO(bN2Z2}{*$T)GB?UQFl_#WGX7K#yUv*zqwJ@-0|M$K6JJW@b-AA$0CTX_tf}Kb5*XJM9)qcPF#Sjfi7jN`(_eAd)78Q#$enLDk zge2mTp)-VNDMd_w!n4;*NGgAYiH}17KlwDq*SqiF(GY=wj}t&=6TXEr4>(nh^i~INTgJy{Ug-gRv>L2SPLU)_a-r93KM(dea-Q@s_t3U&_00!i= zGVds8zpfSz|L%PZ3jvZzfJ510m)Y$dMIDJ(YhO3(?Cm&zU}Kl2t%cS#ww|MLOCgyQ z(!`o!&H4u(pfR{{5k^pW@Z!TyfFL0dH!y?byip$p8#56aY(WfIDG)bU84wp(I}#Cw zj>1F;bQB>9ECIv=wi}2SY!4FQgU*IT_@T2W5&-K3BnZ|UeFy;%u`kI7$OL2%AP-(7F* z&PB&>xZn#-oR6vqpL&pEHa~0=Ir})@wdK+H;jk(tb?1V#^xbJg*CY<^P8~9C?S}p9 z)fioyIItjP@~SlHF=h3JgF!w{iu8pMOx=~$WBq}DV8!HpRs(g;#$ej4COy7(|DNLD z_4~ZG;wo$Z!t{78p4Lw91yR1;>Hbxzn4zmv1EFg(T}=V(rB*Q@VwiQ)_^Q;jMwvyvD|IX{tqXHJ<}_+>f*O=8|)})E^HnU zGorXf(dyv3tY&K+nfB(#y3Ar9qIbmu^|jdS*Y*tU!LiwiDn+b+c0GG1_S`?l0BaDD5# zbz##Rr-uM^s8k01#u;shl+*O` z`oulN~6xOBO-5n{0Si8gz@4K|9x$1l4|j zWy=p(#rD&((|D$7=6Te;?Mo18^ScqZ+vp*Hpgl z;ivC}d+Ikgvu=ZasbeZ4dUtI6te5Eo(mhmL00>asbqke$^j!VRIt+30Cr*p+{MQ@( zXIt>{-^lk=>Uai*X@?gDm8IX2RB@Vr*(;nLG26*Ek3fJ3t#F^19PmpKI8>C(!{K;Z z<&GeDNee;YArCZOO0C9O3oZh*f*UX0z)ubRt`3lb1&0_PP|a)&geXTr5#}anqTIF` z=L2w&&IfQ46%PCimE>CnC>Q4MH6Qa17Ez!KF+taek?BNvokwEoD!dg{+_15K*s@tA zYEj>qZ0v_MY;|#lT})d#4nf4yRn%8|8dek?8J1pz1*fUxI7Y{24KdXRH5GIfqUePM zhQ|RTf(TFsf+3)zL2U01QK{b_35MdLz+)ARx=T71jD-!`IidwkXk2l$02+(Nd<-63j|nUMrV$jizR(s~W--C2V`B9| z@@F_CF48##Y zd@|;_D@kU5(6eGlLqeCIlaotWm^sN#6joo9k(u)<>)@^^scKJ;ZD2=)SiXHJwHb(= z7ACf|HiU$?GG1rx-xelT?C7u!?TL{pcm4e#pPM^Bm6x}W*S8RFYvA$mD@toAIZ2}z z;jO9M(fK@VP)tEu8y-QYWx3Jlu2U5h>(l%;yFzE8t<074ab_6bA0^dmkM5+_~d-cz8v*d>s-j@9)!D zGQzyfg;zMwI*pCNtRyyi1B-bZpSI{x$C2n5B<-Qk;j^IkAn(J&v%XVzkPfXqxGe3C znU6Mqh<7j_Dn|9e>@A!Bv2w6tx+=7@?APab|1X;2njXv^k{S}X@DxE!teAH6mw7+%?5!Id z8J}&v^$h+G)l`p(U6L5Bu94W;lrGU$QytrX0fwrIi^<{Y;be~WYISmWXuxFk1o6)w z;)KK|F&zE?rpIa(=*|v`&I(S@!7E@FcBT#sPpNi3nEXVY)VY%_NcK$In@RD84EOgL zHS#834>a?SmdQSox(HKKgcDg=CkTK|VmSPr=ae=#6{TtVgrxrdBy6^DY!7yoJ(GpwQzI;kse3Wqi=XE29!zKp%ljPFBU`!Rh;jt_8(GyDk4iu2ct8 zKStX=F(Ef`O5M3x#De7<;R7CrA!I0=w`inaMapIvEcHgc$?@#LE29!zfIb3$GC5hZ zx;(^w{|j9UiZiDCnEoMG+CG@{#sbt&PbxI!PzKkXn+a>Qz}|Z22tHT}gKW;A(EDxC zNN=ssST+W>lr8G%yZ6OCZa=)H5ueT+CAwi+w&Qv}e|x@F$sH)UJ<_46bXs$AFA0uE zqoojT-UqIYZXG7Kw0!$ZO*bwm$1OBHme6Wvh)uw!Na@p~{x`*#Xni@aRk?)Y{nmHw L1go5#0RR91zqp5t From a53970efcf0a0a1b2de82b995d5fee1c3372b179 Mon Sep 17 00:00:00 2001 From: chenxiaojun <956334972@qq.com> Date: Thu, 21 Nov 2019 20:34:06 +0800 Subject: [PATCH 08/44] =?UTF-8?q?=E6=8E=A8=E5=B9=BF=E5=B9=B3=E5=8F=B0->?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E6=B1=87=E6=80=BB->=E5=85=85=E5=80=BC?= =?UTF-8?q?=E7=8E=A9=E5=AE=B6--=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controller/AutoPackController.class.php | 12 +- .../Admin/Controller/UserController.class.php | 640 ++++++++++-------- .../Admin/Controller/access_data_foldline.txt | 2 +- .../Home/Controller/QueryController.class.php | 27 + 4 files changed, 386 insertions(+), 295 deletions(-) diff --git a/Application/Admin/Controller/AutoPackController.class.php b/Application/Admin/Controller/AutoPackController.class.php index 48f286288..e4a6b4bb1 100644 --- a/Application/Admin/Controller/AutoPackController.class.php +++ b/Application/Admin/Controller/AutoPackController.class.php @@ -297,17 +297,17 @@ class AutoPackController extends Think $map = []; $map['status'] = 1; $map['enable_status'] = ['in', '0,2']; - + $applys = M('apply', 'tab_')->field('id,game_id,game_name,promote_id,promote_account,sdk_version') ->where($map) ->order('bale_sort desc,id desc') ->limit(200) ->select(); - + if (count($applys) == 0) { Printer::export('无等待队列', true); } - + $applyIds = array_column($applys, 'id'); M('apply', 'tab_')->where(['id' => ['in', $applyIds]])->save(['enable_status' => 3]); @@ -353,7 +353,7 @@ class AutoPackController extends Think ->field('a.id,a.game_id,a.game_name,a.promote_account,a.pack_url,a.plist_url,a.promote_id,a.sdk_version,a.enable_status') ->join('tab_apply_launch as al on (al.apply_id=a.id) ') ->where($map) - ->limit(300) + ->limit(300) ->group('a.id') ->select(); foreach ($apply as $key => $value) { @@ -367,7 +367,7 @@ class AutoPackController extends Think $launchmodel -> where(['apply_id' => $value['id']]) -> setField('launch_packge', 0); continue; } - + if (!empty($gameSourceUrl) && is_file($gameSourceUrl)) { $launch = $launchmodel -> where(['apply_id' => $value['id'], 'launch_packge' => array('in', [0, 2, 3])]) -> select(); @@ -1054,6 +1054,4 @@ class AutoPackController extends Think return ''; } } - - } diff --git a/Application/Admin/Controller/UserController.class.php b/Application/Admin/Controller/UserController.class.php index 14fac80d8..8c95a0240 100644 --- a/Application/Admin/Controller/UserController.class.php +++ b/Application/Admin/Controller/UserController.class.php @@ -8,6 +8,7 @@ // +---------------------------------------------------------------------- namespace Admin\Controller; + use User\Api\UserApi; use Com\Wechat; use Com\WechatAuth; @@ -16,32 +17,34 @@ use Com\WechatAuth; * 后台用户控制器 * @author 麦当苗儿 */ -class UserController extends AdminController { +class UserController extends AdminController +{ /** * 用户管理首页 * @author 麦当苗儿 */ - public function index(){ - $nickname = I('nickname'); - if(isset($_REQUEST['status'])){ - $map['status'] = $_REQUEST['status']; - } - if(is_numeric($nickname)){ - $map['uid|nickname']= array(intval($nickname),array('like','%'.$nickname.'%'),'_multi'=>true); - }else{ - $map['nickname'] = array('like', '%'.(string)$nickname.'%'); - } - - $list = $this->lists('Member', $map); + public function index() + { + $nickname = I('nickname'); + if (isset($_REQUEST['status'])) { + $map['status'] = $_REQUEST['status']; + } + if (is_numeric($nickname)) { + $map['uid|nickname'] = array(intval($nickname), array('like', '%' . $nickname . '%'), '_multi' => true); + } else { + $map['nickname'] = array('like', '%' . (string)$nickname . '%'); + } + + $list = $this->lists('Member', $map); int_to_string($list); $this->assign('_list', $list); $this->meta_title = '管理员列表'; - - $this->m_title = '管理员列表'; - $this->assign('commonset',M('Kuaijieicon')->where(['url'=>'User/index','status'=>1])->find()); - + + $this->m_title = '管理员列表'; + $this->assign('commonset', M('Kuaijieicon')->where(['url' => 'User/index', 'status' => 1])->find()); + $this->display(); } @@ -49,7 +52,8 @@ class UserController extends AdminController { * 修改昵称初始化 * @author huajie */ - public function updateNickname(){ + public function updateNickname() + { $nickname = M('Member')->getFieldByUid(UID, 'nickname'); $this->assign('nickname', $nickname); $this->meta_title = '修改昵称'; @@ -60,7 +64,8 @@ class UserController extends AdminController { * 修改昵称提交 * @author huajie */ - public function submitNickname(){ + public function submitNickname() + { //获取参数 $nickname = I('post.nickname'); $password = I('post.password'); @@ -68,25 +73,25 @@ class UserController extends AdminController { empty($password) && $this->error('请输入密码'); //密码验证 - $User = new UserApi(); - $uid = $User->login(UID, $password, 4); + $User = new UserApi(); + $uid = $User->login(UID, $password, 4); ($uid == -2) && $this->error('密码不正确'); - $Member = D('Member'); - $data = $Member->create(array('nickname'=>$nickname)); - if(!$data){ + $Member = D('Member'); + $data = $Member->create(array('nickname' => $nickname)); + if (!$data) { $this->error($Member->getError()); } - $res = $Member->where(array('uid'=>$uid))->save($data); + $res = $Member->where(array('uid' => $uid))->save($data); - if($res){ - $user = session('user_auth'); - $user['username'] = $data['nickname']; + if ($res) { + $user = session('user_auth'); + $user['username'] = $data['nickname']; session('user_auth', $user); session('user_auth_sign', data_auth_sign($user)); $this->success('修改昵称成功!'); - }else{ + } else { $this->error('修改昵称失败!'); } } @@ -95,7 +100,8 @@ class UserController extends AdminController { * 修改密码初始化 * @author huajie */ - public function updatePassword(){ + public function updatePassword() + { $this->meta_title = '修改密码'; $this->display('updatepassword'); } @@ -104,24 +110,25 @@ class UserController extends AdminController { * 修改密码提交 * @author huajie */ - public function submitPassword(){ + public function submitPassword() + { //获取参数 - $password = I('post.old'); + $password = I('post.old'); empty($password) && $this->error('请输入原密码'); $data['password'] = I('post.password'); empty($data['password']) && $this->error('请输入新密码'); $repassword = I('post.repassword'); empty($repassword) && $this->error('请输入确认密码'); - if($data['password'] !== $repassword){ + if ($data['password'] !== $repassword) { $this->error('您输入的新密码与确认密码不一致'); } - $Api = new UserApi(); - $res = $Api->updateInfo(UID, $password, $data); - if($res['status']){ + $Api = new UserApi(); + $res = $Api->updateInfo(UID, $password, $data); + if ($res['status']) { $this->success('修改密码成功!'); - }else{ + } else { $this->error($res['info']); } } @@ -130,13 +137,14 @@ class UserController extends AdminController { * 用户行为列表 * @author huajie */ - public function action(){ + public function action() + { //获取列表数据 - $Action = M('Action')->where(array('status'=>array('gt',-1))); - $list = $this->lists($Action); + $Action = M('Action')->where(array('status' => array('gt', -1))); + $list = $this->lists($Action); int_to_string($list); // 记录当前列表页的cookie - Cookie('__forward__',$_SERVER['REQUEST_URI']); + Cookie('__forward__', $_SERVER['REQUEST_URI']); $this->assign('_list', $list); $this->meta_title = '用户行为'; @@ -147,9 +155,10 @@ class UserController extends AdminController { * 新增行为 * @author huajie */ - public function addAction(){ + public function addAction() + { $this->meta_title = '新增行为'; - $this->assign('data',null); + $this->assign('data', null); $this->display('editaction'); } @@ -157,12 +166,13 @@ class UserController extends AdminController { * 编辑行为 * @author huajie */ - public function editAction(){ + public function editAction() + { $id = I('get.id'); empty($id) && $this->error('参数不能为空!'); $data = M('Action')->field(true)->find($id); - $this->assign('data',$data); + $this->assign('data', $data); $this->meta_title = '编辑行为'; $this->display('editaction'); } @@ -171,12 +181,13 @@ class UserController extends AdminController { * 更新行为 * @author huajie */ - public function saveAction(){ + public function saveAction() + { $res = D('Action')->update(); - if(!$res){ + if (!$res) { $this->error(D('Action')->getError()); - }else{ - $this->success($res['id']?'更新成功!':'新增成功!', Cookie('__forward__')); + } else { + $this->success($res['id'] ? '更新成功!' : '新增成功!', Cookie('__forward__')); } } @@ -184,23 +195,24 @@ class UserController extends AdminController { * 会员状态修改 * @author 朱亚杰 */ - public function changeUserStatus($method=null){ - $id = array_unique((array)I('id',0)); - if( in_array(C('USER_ADMINISTRATOR'), $id)){ + public function changeUserStatus($method = null) + { + $id = array_unique((array)I('id', 0)); + if (in_array(C('USER_ADMINISTRATOR'), $id)) { $this->error("不允许对超级管理员执行该操作!"); } - $id = is_array($id) ? implode(',',$id) : $id; - if ( empty($id) ) { + $id = is_array($id) ? implode(',', $id) : $id; + if (empty($id)) { $this->error('请选择要操作的数据!'); } - $map['uid'] = array('in',$id); - $map1['id'] = array('in',$id); - $status=I('method')=='forbidUser'?0:1; - $res= M('UcenterMember')->where($map1)->setField('status',$status); - $res1= M('Member')->where($map)->setField('status',$status); - if($res&&$res1){ + $map['uid'] = array('in', $id); + $map1['id'] = array('in', $id); + $status = I('method') == 'forbidUser' ? 0 : 1; + $res = M('UcenterMember')->where($map1)->setField('status', $status); + $res1 = M('Member')->where($map)->setField('status', $status); + if ($res && $res1) { $this->success('更新成功!'); - }else{ + } else { $this->error('更新失败!'); } @@ -211,43 +223,45 @@ class UserController extends AdminController { * 会员状态修改 * @author 朱亚杰 */ - public function changeStatus($method=null){ - $id = array_unique((array)I('id',0)); - if( in_array(C('USER_ADMINISTRATOR'), $id)){ + public function changeStatus($method = null) + { + $id = array_unique((array)I('id', 0)); + if (in_array(C('USER_ADMINISTRATOR'), $id)) { $this->error("不允许对超级管理员执行该操作!"); } - $id = is_array($id) ? implode(',',$id) : $id; - if ( empty($id) ) { + $id = is_array($id) ? implode(',', $id) : $id; + if (empty($id)) { $this->error('请选择要操作的数据!'); } - $map['uid'] = array('in',$id); - switch ( strtolower($method) ){ + $map['uid'] = array('in', $id); + switch (strtolower($method)) { case 'forbiduser': - \Think\Log::actionLog('User/changeStatus?method=forbidUser','user',1); - $this->forbid('Member', $map ); + \Think\Log::actionLog('User/changeStatus?method=forbidUser', 'user', 1); + $this->forbid('Member', $map); break; case 'resumeuser': - \Think\Log::actionLog('User/changeStatus?method=resumeuser','user',1); - $this->resume('Member', $map ); + \Think\Log::actionLog('User/changeStatus?method=resumeuser', 'user', 1); + $this->resume('Member', $map); break; case 'deleteuser': - \Think\Log::actionLog('User/changeStatus?method=deleteuser','user',1); - $this->delete('Member', $map ); + \Think\Log::actionLog('User/changeStatus?method=deleteuser', 'user', 1); + $this->delete('Member', $map); break; default: $this->error('参数非法'); } } - public function add($username = '', $password = '', $repassword = '', $email = '',$second_pwd=''){ + public function add($username = '', $password = '', $repassword = '', $email = '', $second_pwd = '') + { - if(IS_POST){ + if (IS_POST) { /*检测用户名是否为空*/ - if (empty($username)){ + if (empty($username)) { $this->error('管理员账号不能为空!'); } /* 检测密码 */ - if($password != $repassword){ + if ($password != $repassword) { $this->error('管理员密码和确认密码不一致!'); } $usernameUser = M('UcenterMember', 'sys_')->field('username')->where(['username' => $username])->find(); @@ -259,84 +273,87 @@ class UserController extends AdminController { $this->error('邮箱已存在!'); } /* 调用注册接口注册用户 */ - $User = new UserApi; - $uid = $User->register($username, $password, $email,$second_pwd); - if(0 < $uid){ //注册成功 + $User = new UserApi; + $uid = $User->register($username, $password, $email, $second_pwd); + if (0 < $uid) { //注册成功 $user = array('uid' => $uid, 'nickname' => $username, 'status' => 1); $data['uid'] = $uid; $data['group_id'] = I('auth'); M('auth_group_access')->data($data)->add(); - if(!M('Member')->add($user)){ + if (!M('Member')->add($user)) { $this->error('用户添加失败!'); } else { - \Think\Log::actionLog('User/add','Member',$uid); - $this->success('用户添加成功!',U('index')); + \Think\Log::actionLog('User/add', 'Member', $uid); + $this->success('用户添加成功!', U('index')); } } else { //注册失败,显示错误信息 $this->error($this->showRegError($uid)); } } else { - $list=D('AuthGroup')->where(array('status'=>1))->select(); - $this->assign('lists',$list); + $list = D('AuthGroup')->where(array('status' => 1))->select(); + $this->assign('lists', $list); $this->meta_title = '新增管理员'; - - - $this->m_title = '管理员列表'; - $this->assign('commonset',M('Kuaijieicon')->where(['url'=>'User/index','status'=>1])->find()); - - + + $this->m_title = '管理员列表'; + $this->assign('commonset', M('Kuaijieicon')->where(['url' => 'User/index', 'status' => 1])->find()); + + $this->display(); } } -/** - * 系统非常规MD5加密方法 - * @param string $str 要加密的字符串 - * @return string - */ -function think_ucenter_md5($str, $key = 'ThinkUCenter'){ - return '' === $str ? '' : md5(sha1($str) . $key); -} - public function edit($id){ + + /** + * 系统非常规MD5加密方法 + * @param string $str 要加密的字符串 + * @return string + */ + function think_ucenter_md5($str, $key = 'ThinkUCenter') + { + return '' === $str ? '' : md5(sha1($str) . $key); + } + + public function edit($id) + { // var_dump(session());exit; - if(IS_POST){ - if(isset($_POST['bind_wx'])){ - if($_POST['bind_wx']=='unbind_wx'){ - $info['admin_openid']=''; - }else{ - $info['admin_openid']=session('admin_openid'); - if($info['admin_openid']==''){ + if (IS_POST) { + if (isset($_POST['bind_wx'])) { + if ($_POST['bind_wx'] == 'unbind_wx') { + $info['admin_openid'] = ''; + } else { + $info['admin_openid'] = session('admin_openid'); + if ($info['admin_openid'] == '') { $this->error('请在30分钟内扫描并关注微信公众号!'); } } } - if($_POST['auth']==''&&$id!=1){ + if ($_POST['auth'] == '' && $id != 1) { $this->error('请选择用户权限!'); } - if($_POST['password']==''){ + if ($_POST['password'] == '') { //$this->error('请填写管理员密码!'); } - if(!empty($_POST['password']) && (strlen($_POST['password'])<6 || strlen($_POST['password']) > 30)){ + if (!empty($_POST['password']) && (strlen($_POST['password']) < 6 || strlen($_POST['password']) > 30)) { $this->error('管理员密码长度必须在6-30个字符之间!'); } - if($_POST['second_pwd']==''){ + if ($_POST['second_pwd'] == '') { //$this->error('请填写二级密码!'); } - if(!empty($_POST['second_pwd']) && (strlen($_POST['second_pwd'])<6 || strlen($_POST['second_pwd']) > 30)){ + if (!empty($_POST['second_pwd']) && (strlen($_POST['second_pwd']) < 6 || strlen($_POST['second_pwd']) > 30)) { $this->error('二级密码长度必须在6-30个字符之间!'); } - if($_POST['email']==''){ + if ($_POST['email'] == '') { $this->error('请填写邮箱!'); } - - $pattern = "/([a-z0-9]*[-_.]?[a-z0-9]+)*@([a-z0-9]*[-_]?[a-z0-9]+)+[.][a-z]{2,3}([.][a-z]{2})?/i"; - - if(!preg_match( $pattern, $_POST['email'])) { - $this->error('邮箱格式不正确!'); - } - if(isset($_POST['mobile'])&&$_POST['mobile']!=''){ + + $pattern = "/([a-z0-9]*[-_.]?[a-z0-9]+)*@([a-z0-9]*[-_]?[a-z0-9]+)+[.][a-z]{2,3}([.][a-z]{2})?/i"; + + if (!preg_match($pattern, $_POST['email'])) { + $this->error('邮箱格式不正确!'); + } + if (isset($_POST['mobile']) && $_POST['mobile'] != '') { $dx = A('Phone'); - $res = $dx->check_tel_code($_POST['mobile'],$_POST['code']); + $res = $dx->check_tel_code($_POST['mobile'], $_POST['code']); switch ($res) { case '-1': $this->error('短信验证码无效,请重新获取'); @@ -349,27 +366,27 @@ function think_ucenter_md5($str, $key = 'ThinkUCenter'){ break; } } - $Member=D('UcenterMember'); - $mem=D('Member'); - $au=D('AuthGroupAccess'); - $map['id']=$id; - $maps['uid']=$id; - $info['username']=$_POST['username']; - $in['nickname']=$_POST['username']; - $pwd=$this->think_ucenter_md5($_POST['password'],UC_AUTH_KEY); - $spwd=$this->think_ucenter_md5($_POST['second_pwd'],UC_AUTH_KEY); - $rpwd=$Member->where(array('id'=>$id))->find(); - $oldpwd=$rpwd['password']; - $oldspwd=$rpwd['second_pwd']; + $Member = D('UcenterMember'); + $mem = D('Member'); + $au = D('AuthGroupAccess'); + $map['id'] = $id; + $maps['uid'] = $id; + $info['username'] = $_POST['username']; + $in['nickname'] = $_POST['username']; + $pwd = $this->think_ucenter_md5($_POST['password'], UC_AUTH_KEY); + $spwd = $this->think_ucenter_md5($_POST['second_pwd'], UC_AUTH_KEY); + $rpwd = $Member->where(array('id' => $id))->find(); + $oldpwd = $rpwd['password']; + $oldspwd = $rpwd['second_pwd']; $User = new UserApi; - $info['password']= (empty($pwd) || $pwd==$oldpwd)?$oldpwd:$pwd; - $info['second_pwd']= (empty($spwd) || $spwd==$oldspwd)?$oldspwd:$spwd; - $info['email']=$_POST['email']; - $info['mobile']=isset($_POST['mobile'])?$_POST['mobile']:''; - $ss['group_id']=$_POST['auth']; - $ss['houtai']=$_POST['houtai']; - $smember=$Member->where($map)->save($info); - $meb=$mem->where($maps)->save($in); + $info['password'] = (empty($pwd) || $pwd == $oldpwd) ? $oldpwd : $pwd; + $info['second_pwd'] = (empty($spwd) || $spwd == $oldspwd) ? $oldspwd : $spwd; + $info['email'] = $_POST['email']; + $info['mobile'] = isset($_POST['mobile']) ? $_POST['mobile'] : ''; + $ss['group_id'] = $_POST['auth']; + $ss['houtai'] = $_POST['houtai']; + $smember = $Member->where($map)->save($info); + $meb = $mem->where($maps)->save($in); if ($au->where(array('uid' => $id))->find()) { if ($ss['group_id'] == '') { unset($ss['group_id']); @@ -379,178 +396,223 @@ function think_ucenter_md5($str, $key = 'ThinkUCenter'){ $ss['uid'] = $id; $ag = $au->add($ss); } - - if($smember !== false||$meb||$ag){ - M('user_pwd')->where($maps)->setField('password',think_encrypt($info['password'])); - $this->success('修改成功!',U('User/index')); - }else{ - $this->error('修改失败!',U('User/index')); + + if ($smember !== false || $meb || $ag) { + M('user_pwd')->where($maps)->setField('password', think_encrypt($info['password'])); + $this->success('修改成功!', U('User/index')); + } else { + $this->error('修改失败!', U('User/index')); } - }else{ - $map['id']=$_GET['id']; - $Member=D('UcenterMember')->where($map)->find(); - $au=D('AuthGroupAccess')->where(array('uid'=>$_GET['id']))->find(); - $this->assign("authid",$au["group_id"]); - $this->assign("houtai",$au["houtai"]); - $list=D('AuthGroup')->where(array('status'=>1))->select(); - $username=$_POST['username']; - $password=$_POST['password']; - $this->assign('lists',$list); - $this->assign('list',$Member); - $this->assign('sd',$group); - $this->meta_title = '编辑管理员'; - - $this->m_title = '管理员列表'; - $this->assign('commonset',M('Kuaijieicon')->where(['url'=>'User/index','status'=>1])->find()); - - + } else { + $map['id'] = $_GET['id']; + $Member = D('UcenterMember')->where($map)->find(); + $au = D('AuthGroupAccess')->where(array('uid' => $_GET['id']))->find(); + $this->assign("authid", $au["group_id"]); + $this->assign("houtai", $au["houtai"]); + $list = D('AuthGroup')->where(array('status' => 1))->select(); + $username = $_POST['username']; + $password = $_POST['password']; + $this->assign('lists', $list); + $this->assign('list', $Member); + $this->assign('sd', $group); + $this->meta_title = '编辑管理员'; + + $this->m_title = '管理员列表'; + $this->assign('commonset', M('Kuaijieicon')->where(['url' => 'User/index', 'status' => 1])->find()); + + $this->display(); } } - public function bdwx(){ - $map['id']=UID; - $Member=D('UcenterMember')->field('id,username,admin_openid,openid_sign')->where($map)->find(); - $this->assign('id',$map['id']); - $this->assign('list',$Member); + + public function bdwx() + { + $map['id'] = UID; + $Member = D('UcenterMember')->field('id,username,admin_openid,openid_sign')->where($map)->find(); + $this->assign('id', $map['id']); + $this->assign('list', $Member); $this->meta_title = '绑定微信'; $this->display(); } - public function updatelist($p=0){ + + public function updatelist($p = 0) + { $page = intval($p); $page = $page ? $page : 1; //默认显示第一页数据 - if(isset($_REQUEST['row'])) {$row = $_REQUEST['row'];}else{$row = 10;} - if(isset($_REQUEST['op_account'])){ - if ($_REQUEST['op_account']=='全部') { + if (isset($_REQUEST['row'])) { + $row = $_REQUEST['row']; + } else { + $row = 10; + } + if (isset($_REQUEST['op_account'])) { + if ($_REQUEST['op_account'] == '全部') { unset($_REQUEST['op_account']); - }else{ - $map['op_account'] = trim($_REQUEST['op_account']); + } else { + $map['op_account'] = trim($_REQUEST['op_account']); unset($_REQUEST['op_account']); } } - if(isset($_REQUEST['game_name'])){ - $map['game_name'] = trim($_REQUEST['game_name']); + if (isset($_REQUEST['game_name'])) { + $map['game_name'] = trim($_REQUEST['game_name']); unset($_REQUEST['game_name']); } - if(isset($_REQUEST['account'])){ - $map['user_account'] = array('like','%'.trim($_REQUEST['account']).'%'); + if (isset($_REQUEST['account'])) { + $map['user_account'] = array('like', '%' . trim($_REQUEST['account']) . '%'); unset($_REQUEST['account']); } - if(isset($_REQUEST['huobi'])){ - $map['type'] = $_REQUEST['huobi']; + if (isset($_REQUEST['huobi'])) { + $map['type'] = $_REQUEST['huobi']; unset($_REQUEST['huobi']); } - if(isset($_REQUEST['timestart']) && isset($_REQUEST['timeend'])){ - $map['create_time'] = array('BETWEEN',array(strtotime($_REQUEST['timestart']),strtotime($_REQUEST['timeend'])+24*60*60-1)); - unset($_REQUEST['timestart']);unset($_REQUEST['timeend']); - }elseif(isset($_REQUEST['timestart'])){ - $map['create_time'] = ['GT',strtotime(I('timestart'))]; + if (isset($_REQUEST['timestart']) && isset($_REQUEST['timeend'])) { + $map['create_time'] = array('BETWEEN', array(strtotime($_REQUEST['timestart']), strtotime($_REQUEST['timeend']) + 24 * 60 * 60 - 1)); unset($_REQUEST['timestart']); - }elseif(isset($_REQUEST['timeend'])){ - $map['create_time'] = ['LT',strtotime(I('timeend'))+86399]; + unset($_REQUEST['timeend']); + } elseif (isset($_REQUEST['timestart'])) { + $map['create_time'] = ['GT', strtotime(I('timestart'))]; + unset($_REQUEST['timestart']); + } elseif (isset($_REQUEST['timeend'])) { + $map['create_time'] = ['LT', strtotime(I('timeend')) + 86399]; unset($_REQUEST['timeend']); } - $list=M('balance_edit','tab_') + $list = M('balance_edit', 'tab_') ->where($map) ->order('create_time desc') ->page($page, $row) ->select(); - $count = M('balance_edit','tab_')->where($map)->count(); + $count = M('balance_edit', 'tab_')->where($map)->count(); //分页 - $page = set_pagination($count,$row); - if($page) {$this->assign('_page', $page);} - - $this->assign('list',$list); + $page = set_pagination($count, $row); + if ($page) { + $this->assign('_page', $page); + } + + $this->assign('list', $list); $this->meta_title = '修改记录'; - - $this->m_title = '账户修改记录'; - $this->assign('commonset',M('Kuaijieicon')->where(['url'=>'Member/login_record','status'=>1])->find()); - - + + $this->m_title = '账户修改记录'; + $this->assign('commonset', M('Kuaijieicon')->where(['url' => 'Member/login_record', 'status' => 1])->find()); + + $this->display('updatelist'); } + /** * 获取用户注册错误信息 - * @param integer $code 错误编码 + * @param integer $code 错误编码 * @return string 错误信息 */ - private function showRegError($code = 0){ + private function showRegError($code = 0) + { switch ($code) { - case -1: $error = '管理员账号长度必须在16个字符以内!'; break; - case -2: $error = '管理员账号被禁止注册!'; break; - case -3: $error = '管理员账号被占用!'; break; - case -4: $error = '管理员密码长度必须在6-30个字符之间!'; break; - case -5: $error = '邮箱格式不正确!'; break; - case -6: $error = '邮箱长度必须在1-32个字符之间!'; break; - case -7: $error = '邮箱被禁止注册!'; break; - case -8: $error = '邮箱被占用!'; break; - case -9: $error = '手机格式不正确!'; break; - case -10: $error = '手机被禁止注册!'; break; - case -11: $error = '手机号被占用!'; break; - case -12: $error = '二级密码长度必须在6-30个字符之间!';break; - default: $error = '未知错误'; + case -1: + $error = '管理员账号长度必须在16个字符以内!'; + break; + case -2: + $error = '管理员账号被禁止注册!'; + break; + case -3: + $error = '管理员账号被占用!'; + break; + case -4: + $error = '管理员密码长度必须在6-30个字符之间!'; + break; + case -5: + $error = '邮箱格式不正确!'; + break; + case -6: + $error = '邮箱长度必须在1-32个字符之间!'; + break; + case -7: + $error = '邮箱被禁止注册!'; + break; + case -8: + $error = '邮箱被占用!'; + break; + case -9: + $error = '手机格式不正确!'; + break; + case -10: + $error = '手机被禁止注册!'; + break; + case -11: + $error = '手机号被占用!'; + break; + case -12: + $error = '二级密码长度必须在6-30个字符之间!'; + break; + default: + $error = '未知错误'; } return $error; } - public function get_openid(){ + + public function get_openid() + { $User = new UserApi; - if($_POST['id']>999){ - $this->ajaxReturn(array('status'=>0,'msg'=>'管理员id不能大于999')); + if ($_POST['id'] > 999) { + $this->ajaxReturn(array('status' => 0, 'msg' => '管理员id不能大于999')); } $data = $User->verifyPwd($_POST['id'], $_POST['pwd']); - if(!$data){ - $this->ajaxReturn(array('status'=>0,'msg'=>'密码错误,请重新选择')); + if (!$data) { + $this->ajaxReturn(array('status' => 0, 'msg' => '密码错误,请重新选择')); } - $appid = C('wechat.appid'); + $appid = C('wechat.appid'); $appsecret = C('wechat.appsecret'); - $result=auto_get_access_token(dirname(__FILE__).'/access_token_validity.txt'); - if($result['is_validity']){ - session('token',$result['access_token']); - $auth = new WechatAuth($appid, $appsecret,$result['access_token']); - }else{ - $auth = new WechatAuth($appid, $appsecret); + $result = auto_get_access_token(dirname(__FILE__) . '/access_token_validity.txt'); + if ($result['is_validity']) { + session('token', $result['access_token']); + $auth = new WechatAuth($appid, $appsecret, $result['access_token']); + } else { + $auth = new WechatAuth($appid, $appsecret); $token = $auth->getAccessToken(); - $token['expires_in_validity']=time()+$token['expires_in']; - wite_text(json_encode($token),dirname(__FILE__).'/access_token_validity.txt'); - session('token',$token['access_token']); + $token['expires_in_validity'] = time() + $token['expires_in']; + wite_text(json_encode($token), dirname(__FILE__) . '/access_token_validity.txt'); + session('token', $token['access_token']); } - $times=date('s',time()); + $times = date('s', time()); // $scene_id=strrev($_POST['id'].$times); - $scene_id=$_POST['id'].$times.$_POST['type']; - session('scene_id',$scene_id); - $ticket = $auth->qrcodeCreate($scene_id,600);//10分钟 - if($ticket==''){ - $return=array('status'=>0,'data'=>'获取ticket失败!'); + $scene_id = $_POST['id'] . $times . $_POST['type']; + session('scene_id', $scene_id); + $ticket = $auth->qrcodeCreate($scene_id, 600);//10分钟 + if ($ticket == '') { + $return = array('status' => 0, 'data' => '获取ticket失败!'); } $qrcode = $auth->showqrcode($ticket['ticket']); - $return=array('status'=>1,'data'=>$qrcode); + $return = array('status' => 1, 'data' => $qrcode); $this->ajaxReturn($return); } - function checkpwd(){ + + function checkpwd() + { $User = new UserApi; $data = $User->verifyPwd($_POST['id'], $_POST['pwd']); - $this->ajaxReturn(array('data'=>$data)); + $this->ajaxReturn(array('data' => $data)); } - function checkOpenidpic(){ + + function checkOpenidpic() + { sleep(2); - $data=M('ucenter_member')->where(array('id'=>$_REQUEST['id']))->find(); - if($data['openid_sign']==session('scene_id')){ - $this->ajaxReturn(array("status"=>1)); - }else{ - $this->ajaxReturn(array("status"=>0)); + $data = M('ucenter_member')->where(array('id' => $_REQUEST['id']))->find(); + if ($data['openid_sign'] == session('scene_id')) { + $this->ajaxReturn(array("status" => 1)); + } else { + $this->ajaxReturn(array("status" => 0)); } } - public function delete($id){ + public function delete($id) + { M()->startTrans(); $res1 = M('member')->delete($id); $res2 = M('ucenter_member')->delete($id); - $res3 = M('auth_group_access')->where(array('uid'=>$id))->delete(); - if($res1 && $res2 && $res3){ + $res3 = M('auth_group_access')->where(array('uid' => $id))->delete(); + if ($res1 && $res2 && $res3) { M()->commit(); $this->success('删除成功'); - }else{ + } else { M()->rollback(); - $this->error('删除失败'.M()->getError()); + $this->error('删除失败' . M()->getError()); } } @@ -558,7 +620,7 @@ function think_ucenter_md5($str, $key = 'ThinkUCenter'){ { $map = []; if (isset($_REQUEST['game_name'])) { - $map['game_name'] = ['like', trim($_REQUEST['game_name'])."%"]; + $map['game_name'] = ['like', trim($_REQUEST['game_name']) . "%"]; unset($_REQUEST['game_name']); } if (isset($_REQUEST['server_id'])) { @@ -578,19 +640,19 @@ function think_ucenter_md5($str, $key = 'ThinkUCenter'){ $promoter_ids = D("Promote")->where($queryStr)->field('id')->select(); $promoter_ids ? $map['promote_id'] = ['in', implode(',', array_column($promoter_ids, 'id'))] : null; } - + } if (isset($_REQUEST['game_type'])) { $map['sdk_version'] = trim($_REQUEST['game_type']); unset($_REQUEST['game_type']); } - empty(I('user_account')) || $map['user_account'] = ['like',"%".I('user_account')."%"]; + empty(I('user_account')) || $map['user_account'] = ['like', "%" . I('user_account') . "%"]; $list = $this->lists(M('user_play_info', 'tab_'), $map, 'play_time desc'); $this->assign('list', $list); $this->meta_title = '角色数据'; - - $this->m_title = '角色查询'; - $this->assign('commonset',M('Kuaijieicon')->where(['url'=>'User/rolelist','status'=>1])->find()); + + $this->m_title = '角色查询'; + $this->assign('commonset', M('Kuaijieicon')->where(['url' => 'User/rolelist', 'status' => 1])->find()); $this->display(); @@ -600,47 +662,51 @@ function think_ucenter_md5($str, $key = 'ThinkUCenter'){ * 更新游戏角色数据 * @param $id */ - public function user_update($ids){ + public function user_update($ids) + { $res = D('User')->update_user_player($ids); $this->success("更新成功:{$res['suc']}个,失败:{$res['ero']}"); } + /** * 更新游戏角色数据 * @param $id */ - public function age(){ - if (IS_POST){ + public function age() + { + if (IS_POST) { $data = $_POST; $a = new ToolController(); $re = $a->save($data); - \Think\Log::actionLog('User/age','User',1); + \Think\Log::actionLog('User/age', 'User', 1); $this->success('保存成功'); - }else{ - $data = I('type',1) == 1? C('age'):C('age_prevent'); - $this->assign('data',$data); - $this->meta_title = I('type',1) == 1?"实名认证设置":'防沉迷设置'; - - $this->m_title = I('type',1)==1?'实名认证设置':'防沉迷设置'; - $this->assign('commonset',M('Kuaijieicon')->where(['url'=>'User/age/type/'.I('type',1),'status'=>1])->find()); - + } else { + $data = I('type', 1) == 1 ? C('age') : C('age_prevent'); + $this->assign('data', $data); + $this->meta_title = I('type', 1) == 1 ? "实名认证设置" : '防沉迷设置'; + + $this->m_title = I('type', 1) == 1 ? '实名认证设置' : '防沉迷设置'; + $this->assign('commonset', M('Kuaijieicon')->where(['url' => 'User/age/type/' . I('type', 1), 'status' => 1])->find()); + $this->display(); } - + } - public function update_pwd(){ - if(IS_POST){ - if(strlen($_POST['new_pwd'])<6||strlen($_POST['new_pwd'])>30){ + public function update_pwd() + { + if (IS_POST) { + if (strlen($_POST['new_pwd']) < 6 || strlen($_POST['new_pwd']) > 30) { $this->error('密码格式不正确!'); } - $oldspwd=$this->think_ucenter_md5($_POST['password'],UC_AUTH_KEY); - $newpwd =$this->think_ucenter_md5($_POST['new_pwd'],UC_AUTH_KEY); - $Member=D('UcenterMember'); - $rpwd=$Member->where(array('id'=>session('user_auth.uid')))->find(); - if($oldspwd==$rpwd['password']){ - $Member->where(array('id'=>session('user_auth.uid')))->save(['password'=>$newpwd]); - $this->success('修改成功!',U('User/index')); - }else{ + $oldspwd = $this->think_ucenter_md5($_POST['password'], UC_AUTH_KEY); + $newpwd = $this->think_ucenter_md5($_POST['new_pwd'], UC_AUTH_KEY); + $Member = D('UcenterMember'); + $rpwd = $Member->where(array('id' => session('user_auth.uid')))->find(); + if ($oldspwd == $rpwd['password']) { + $Member->where(array('id' => session('user_auth.uid')))->save(['password' => $newpwd]); + $this->success('修改成功!', U('User/index')); + } else { $this->error('原密码错误!'); } @@ -648,14 +714,14 @@ function think_ucenter_md5($str, $key = 'ThinkUCenter'){ $this->display(); } - public function get_server_lists($game_id=0){ - $server = M("server","tab_"); + public function get_server_lists($game_id = 0) + { + $server = M("server", "tab_"); $map['game_id'] = $game_id; $lists = $server->field('id,server_name,game_name')->where($map)->select(); - if(empty($lists)){ - return $this->ajaxReturn(array('status'=>0,'data'=>'')); + if (empty($lists)) { + return $this->ajaxReturn(array('status' => 0, 'data' => '')); } - return $this->ajaxReturn(array('status'=>1,'data'=>$lists)); + return $this->ajaxReturn(array('status' => 1, 'data' => $lists)); } - } \ No newline at end of file diff --git a/Application/Admin/Controller/access_data_foldline.txt b/Application/Admin/Controller/access_data_foldline.txt index ea73b15ce..bc484849f 100644 --- a/Application/Admin/Controller/access_data_foldline.txt +++ b/Application/Admin/Controller/access_data_foldline.txt @@ -1 +1 @@ -{"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 +{"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}]} \ No newline at end of file diff --git a/Application/Home/Controller/QueryController.class.php b/Application/Home/Controller/QueryController.class.php index 2529f6bd4..2eef90db1 100644 --- a/Application/Home/Controller/QueryController.class.php +++ b/Application/Home/Controller/QueryController.class.php @@ -2098,4 +2098,31 @@ class QueryController extends BaseController $this->ajaxReturn($data); } + + public function userPlayDataCount() + { + $time = strtotime(date('Y-m-d 00:00:00',time() - (3600 * 24))); + $spendMap['pay_status'] = 1; + $spendMap['pay_game_status'] = 1; + $spendMap['game_player_id'] = ['gt', 0]; + $spendMap['pay_time'] = ['between', [$time, strtotime(date('Y-m-d 23:59:59', $time))]]; + + $field = 'FROM_UNIXTIME(pay_time,"%Y-%m-%d") as day,game_id,server_id,game_player_id,sum(pay_amount) as recharge_cost,count(id) as recharge_count'; + $spendCostData = M('spend', 'tab_')->field($field) + ->where($spendMap) + ->group('day,game_player_id,server_id,game_id') + ->select(); + + $data = []; + foreach ($spendCostData as $list) { + $save['game_id'] = $list['game_id']; + $save['server_id'] = $list['server_id']; + $save['role_id'] = $list['game_player_id']; + $save['recharge_cost'] = $list['recharge_cost']; + $save['recharge_count'] = $list['recharge_count']; + $save['create_time'] = strtotime($list['day']); + $data[] = $save; + } + M('user_play_data_count', 'tab_')->addAll($data); + } } From 09ab8bf8adda659827f9e3b67a97368f8b854fd4 Mon Sep 17 00:00:00 2001 From: chenxiaojun <956334972@qq.com> Date: Thu, 21 Nov 2019 20:38:22 +0800 Subject: [PATCH 09/44] =?UTF-8?q?=E6=8E=A8=E5=B9=BF=E5=B9=B3=E5=8F=B0->?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E6=B1=87=E6=80=BB->=E5=85=85=E5=80=BC?= =?UTF-8?q?=E7=8E=A9=E5=AE=B6--=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Home/Controller/QueryController.class.php | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/Application/Home/Controller/QueryController.class.php b/Application/Home/Controller/QueryController.class.php index 1c4473c52..b9577352e 100644 --- a/Application/Home/Controller/QueryController.class.php +++ b/Application/Home/Controller/QueryController.class.php @@ -2083,4 +2083,31 @@ class QueryController extends BaseController $this->ajaxReturn($data); } + + public function userPlayDataCount() + { + $time = strtotime(date('Y-m-d 00:00:00',time() - (3600 * 24))); + $spendMap['pay_status'] = 1; + $spendMap['pay_game_status'] = 1; + $spendMap['game_player_id'] = ['gt', 0]; + $spendMap['pay_time'] = ['between', [$time, strtotime(date('Y-m-d 23:59:59', $time))]]; + + $field = 'FROM_UNIXTIME(pay_time,"%Y-%m-%d") as day,game_id,server_id,game_player_id,sum(pay_amount) as recharge_cost,count(id) as recharge_count'; + $spendCostData = M('spend', 'tab_')->field($field) + ->where($spendMap) + ->group('day,game_player_id,server_id,game_id') + ->select(); + + $data = []; + foreach ($spendCostData as $list) { + $save['game_id'] = $list['game_id']; + $save['server_id'] = $list['server_id']; + $save['role_id'] = $list['game_player_id']; + $save['recharge_cost'] = $list['recharge_cost']; + $save['recharge_count'] = $list['recharge_count']; + $save['create_time'] = strtotime($list['day']); + $data[] = $save; + } + M('user_play_data_count', 'tab_')->addAll($data); + } } From 3e68880ac08639ad54aee892dd02f00ae2019aed Mon Sep 17 00:00:00 2001 From: chenxiaojun <956334972@qq.com> Date: Thu, 21 Nov 2019 20:39:34 +0800 Subject: [PATCH 10/44] =?UTF-8?q?=E6=8E=A8=E5=B9=BF=E5=B9=B3=E5=8F=B0->?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E6=B1=87=E6=80=BB->=E5=85=85=E5=80=BC?= =?UTF-8?q?=E7=8E=A9=E5=AE=B6--=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Home/Controller/QueryController.class.php | 196 ++++++++++-------- 1 file changed, 105 insertions(+), 91 deletions(-) diff --git a/Application/Home/Controller/QueryController.class.php b/Application/Home/Controller/QueryController.class.php index b9577352e..2958e383d 100644 --- a/Application/Home/Controller/QueryController.class.php +++ b/Application/Home/Controller/QueryController.class.php @@ -1709,118 +1709,132 @@ class QueryController extends BaseController $isSelf = I('is_self', 0); $roleName = I('role_name', ''); $userAccount = I('user_account', ''); - $promoteId = I('promote_id', 0); $sdkVersion = I('sdk_version', 0); $costBegin = I('cost_begin', ''); $costEnd = I('cost_end', ''); + $sortName = trim(I('sort_name', '')); + $sort = intval(I('sort', 1)); + $nowTime = date('Y-m-d'); + $initBegTime = date('Y-m-d', strtotime('-6 day', strtotime($nowTime))); + $initBegTime = empty(I('begtime')) ? $initBegTime : I('begtime'); + $initEndTime = $nowTime; + $initEndTime = empty(I('endtime')) ? $initEndTime : I('endtime'); + $begTime = strtotime($initBegTime); + $endTime = strtotime($initEndTime); + $endTime += 3600 * 24; $promote = $this->getLoginPromote(); $levelPromote = $this->getLevelPromote(); $queryPromote = $this->getQueryPromote($levelPromote); - $map[] = [ - '_logic' => 'or', - 'id' => $queryPromote['id'], - 'chain' => ['like', $queryPromote['chain'] . $queryPromote['id'] . '/%'] - ]; - $ids = M('promote', 'tab_')->where($map)->getField('id', true); - - $map = []; - if (count($ids) > 0) { - $map = ['promote_id' => ['in', $ids]]; - } else { - $map['_string'] = '1<>1'; - } + $records = []; + $pagination = ''; + $count = 0; + if (intval($endTime - $begTime) / (24 * 3600) <= 31) { + $map[] = [ + '_logic' => 'or', + 'id' => $queryPromote['id'], + 'chain' => ['like', $queryPromote['chain'] . $queryPromote['id'] . '/%'] + ]; + $ids = M('promote', 'tab_')->where($map)->getField('id', true); - $spendMap = $map; - if ($gameId != 0) { - $map['game_id'] = $gameId; - } - if ($serverId != 0) { - $map['server_id'] = $serverId; - } - if ($roleName != '') { - $map['role_name'] = ['like', '%' . $roleName . '%']; - } - if ($userAccount != '') { - $map['user_account'] = ['like', '%' . $userAccount . '%']; - } - if ($sdkVersion != 0) { - $map['sdk_version'] = $sdkVersion; - } - if ($isSelf) { - $map['promote_id'] = $queryPromote['id']; - $spendMap['promote_id'] = $queryPromote['id']; - } - if ($costBegin != '' || $costEnd != '') { - $having = ''; - if ($costBegin != '' && $costEnd != '') { - $having = 'sum(cost) between ' . $costBegin . ' and ' . $costEnd; - } elseif ($costBegin != '' && $costEnd == '') { - $having = 'sum(cost) >= ' . $costBegin; - } elseif ($costBegin == '' && $costEnd != '') { - $having = 'sum(cost) <= ' . $costEnd; + $map = []; + if (count($ids) > 0) { + $map = ['promote_id' => ['in', $ids]]; + } else { + $map['_string'] = '1<>1'; } - $subMap = $map; - $subMap['pay_status'] = 1; - $subMap['pay_game_status'] = 1; - $subQuery = M('spend', 'tab_')->field('game_player_id')->where($subMap)->group('game_player_id')->having($having)->buildSql(); - $map['_string'] = 'role_id in (' . $subQuery . ')'; - } - $query = M('user_play_info', 'tab_')->where($map)->order('play_time desc'); - list($roles, $pagination, $count) = $this->paginate($query); - $roleIds = array_column($roles, 'role_id'); - $spendMap['pay_status'] = 1; - $spendMap['pay_game_status'] = 1; - if (count($roleIds) > 0) { - $spendMap['game_player_id'] = ['in', $roleIds]; - } else { - $spendMap['_string'] = '1<>1'; - } - $allRecharges = M('spend', 'tab_')->field('count(*) count, sum(cost) cost, game_player_id')->where($spendMap)->group('game_player_id')->select(); - $allRecords = []; - foreach ($allRecharges as $recharge) { - $allRecords[$recharge['game_player_id']] = $recharge; - } + $subMap = []; + if ($gameId != 0) { + $map['game_id'] = $gameId; + $subMap['game_id'] = $gameId; + } + if ($serverId != 0) { + $map['server_id'] = $serverId; + $subMap['server_id'] = $serverId; + } + if ($roleName != '') { + $map['role_name'] = ['like', '%' . $roleName . '%']; + } + if ($userAccount != '') { + $map['user_account'] = ['like', '%' . $userAccount . '%']; + } + if ($sdkVersion != 0) { + $map['sdk_version'] = $sdkVersion; + } + if ($isSelf) { + $map['promote_id'] = $queryPromote['id']; + } - $spendMap['pay_time'] = ['between', [strtotime(date('Y-m-d 00:00:00')), strtotime(date('Y-m-d 23:59:59'))]]; - $todayRecharges = M('spend', 'tab_')->field('sum(cost) cost, game_player_id')->where($spendMap)->group('game_player_id')->select(); - $todayRecords = []; - foreach ($todayRecharges as $recharge) { - $todayRecords[$recharge['game_player_id']] = $recharge; - } + $subMap['create_time'] = ['between', [$begTime, $endTime - 1]]; + if ($costBegin != '' || $costEnd != '') { + $having = ''; + if ($costBegin != '' && $costEnd != '') { + $having = 'sum(recharge_cost) between ' . $costBegin . ' and ' . $costEnd; + } elseif ($costBegin != '' && $costEnd == '') { + $having = 'sum(recharge_cost) >= ' . $costBegin; + } elseif ($costBegin == '' && $costEnd != '') { + $having = 'sum(recharge_cost) <= ' . $costEnd; + } + $subQuery = M('user_play_data_count', 'tab_')->field('role_id') + ->where($subMap) + ->group('game_id,server_id,role_id') + ->having($having) + ->buildSql(); + $map['_string'] = 'role_id in (' . $subQuery . ')'; + } + $spendMap['uc.create_time'] = ['between', [$begTime, $endTime - 1]]; + $spendMap['_string'] = 'uc.game_id = game_id and uc.server_id = server_id and uc.role_id = role_id'; + $sqlCost = M('user_play_data_count', 'tab_')->alias('uc') + ->field('sum(uc.recharge_cost) cost') + ->where($spendMap) + ->buildSql(); + $sqlCount = M('user_play_data_count', 'tab_')->alias('uc') + ->field('sum(uc.recharge_count) count') + ->where($spendMap) + ->buildSql(); + $spendMap['uc.create_time'] = ['between', [strtotime(date('Y-m-d 00:00:00')), strtotime(date('Y-m-d 23:59:59'))]]; + $sqlTodayCost = M('user_play_data_count', 'tab_')->alias('uc') + ->field('sum(uc.recharge_count) count') + ->where($spendMap) + ->buildSql(); + $query = M('user_play_info', 'tab_') + ->field("*,$sqlCost as cost,$sqlCount as count,$sqlTodayCost as today_cost") + ->where($map) + ->order('play_time desc'); + list($roles, $pagination, $count) = $this->paginate($query); - $records = []; - foreach ($roles as $role) { - $records[] = [ - 'user_account' => encryption($role['user_account']), - 'game_name' => $role['game_name'], - 'role_name' => $role['role_name'], - 'role_id' => $role['role_id'], - 'role_level' => $role['role_level'], - 'server_id' => $role['server_id'], - 'server_name' => $role['server_name'], - 'recharge_cost' => isset($allRecords[$role['role_id']]) ? round(floatval($allRecords[$role['role_id']]['cost']), 2) : 0, - 'recharge_count' => isset($allRecords[$role['role_id']]) ? $allRecords[$role['role_id']]['count'] : 0, - 'recharge_cost_today' => isset($todayRecords[$role['role_id']]) ? round(floatval($todayRecords[$role['role_id']]['cost']), 2) : 0, - 'play_time' => $role['play_time'], - 'play_ip' => $role['play_ip'], - 'promote_id' => $role['promote_id'], - 'promote_account' => $role['promote_account'], - 'sdk_version' => $role['sdk_version'], - 'unlogin_day' => intval((strtotime(date('Y-m-d 00:00:00')) - strtotime(date('Y-m-d 00:00:00', $role['play_time']))) / (24 * 3600)) - ]; + foreach ($roles as $role) { + $records[] = [ + 'user_account' => encryption($role['user_account']), + 'game_name' => $role['game_name'], + 'role_name' => $role['role_name'], + 'role_id' => $role['role_id'], + 'role_level' => $role['role_level'], + 'server_id' => $role['server_id'], + 'server_name' => $role['server_name'], + 'recharge_cost' => $role['cost'], + 'recharge_count' => $role['count'], + 'recharge_cost_today' => $role['cost_today'], + 'play_time' => $role['play_time'], + 'play_ip' => $role['play_ip'], + 'promote_id' => $role['promote_id'], + 'promote_account' => $role['promote_account'], + 'sdk_version' => $role['sdk_version'], + 'unlogin_day' => intval((strtotime(date('Y-m-d 00:00:00')) - strtotime(date('Y-m-d 00:00:00', $role['play_time']))) / (24 * 3600)) + ]; + } } $games = $this->getGamesByPromote($promote); $this->assign('games', $games); - $this->assign('promotes', $promotes); - $this->assign('groupPromotes', $groupPromotes); $this->assign('records', $records); $this->assign('pagination', $pagination); $this->assign('count', $count); + $this->assign('initBegTime', $initBegTime); + $this->assign('initEndTime', $initEndTime); $this->display('userRecharges'); } From 7265a2961e4a7c407c3d9c24486b9e96fdd1561c Mon Sep 17 00:00:00 2001 From: zhengchanglong Date: Thu, 21 Nov 2019 20:43:07 +0800 Subject: [PATCH 11/44] =?UTF-8?q?=E8=B6=85=E7=BA=A7=E7=AD=BE=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2UI=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Application/Mobile/View/Ssg/install_show.html | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Application/Mobile/View/Ssg/install_show.html b/Application/Mobile/View/Ssg/install_show.html index 9fd7f7ebd..c5498212d 100644 --- a/Application/Mobile/View/Ssg/install_show.html +++ b/Application/Mobile/View/Ssg/install_show.html @@ -11,6 +11,9 @@ + - - +
@@ -55,7 +54,6 @@
-
From ee4028610800222979333ec1ef97a9afcf46345d Mon Sep 17 00:00:00 2001 From: zhengyongxing Date: Thu, 21 Nov 2019 21:11:00 +0800 Subject: [PATCH 13/44] =?UTF-8?q?=E7=99=BB=E5=BD=95sdk=E4=B8=BB=E9=A1=B5?= =?UTF-8?q?=E8=B7=B3=E8=BD=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Mobile/Controller/SsgController.class.php | 4 +-- Application/Mobile/View/Ssg/index.html | 30 ++++++++++++++++++- 2 files changed, 31 insertions(+), 3 deletions(-) diff --git a/Application/Mobile/Controller/SsgController.class.php b/Application/Mobile/Controller/SsgController.class.php index 760e72a89..1cdc0efff 100644 --- a/Application/Mobile/Controller/SsgController.class.php +++ b/Application/Mobile/Controller/SsgController.class.php @@ -67,13 +67,13 @@ class SsgController extends BaseController { if ($isToken) { session("user_auth",$isToken); - $this->redirect("Ssg/index"); + $this->redirect("Ssg/index",array('game_id'=>$game_id)); } else { $this->redirect("Ssg/login"); } } else { - $this->redirect("Ssg/login"); +// $this->redirect("Ssg/login"); } //获取客服qq diff --git a/Application/Mobile/View/Ssg/index.html b/Application/Mobile/View/Ssg/index.html index a15c89706..18b8d61f5 100644 --- a/Application/Mobile/View/Ssg/index.html +++ b/Application/Mobile/View/Ssg/index.html @@ -100,6 +100,7 @@
确认支付¥10
+ \ No newline at end of file diff --git a/Application/Home/View/default/Query/userRoles.html b/Application/Home/View/default/Query/userRoles.html index 293793d7e..5ceef8dfb 100644 --- a/Application/Home/View/default/Query/userRoles.html +++ b/Application/Home/View/default/Query/userRoles.html @@ -22,52 +22,51 @@ 角色查询
- +
+ +
+
+ +
+ +
+ +
+
+ +
+
+ + +
+
+ + + + +
+
+ +
+
+ +
@@ -130,6 +129,8 @@ \ No newline at end of file From c923a58536ce9b38b66555bb40127b7b76d6e84b Mon Sep 17 00:00:00 2001 From: chenxiaojun <956334972@qq.com> Date: Thu, 21 Nov 2019 22:38:57 +0800 Subject: [PATCH 25/44] =?UTF-8?q?=E6=8E=A8=E5=B9=BF=E5=B9=B3=E5=8F=B0->?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E6=B1=87=E6=80=BB--bug=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Application/Home/Controller/QueryController.class.php | 1 + 1 file changed, 1 insertion(+) diff --git a/Application/Home/Controller/QueryController.class.php b/Application/Home/Controller/QueryController.class.php index 922ffbeb4..9bcdae958 100644 --- a/Application/Home/Controller/QueryController.class.php +++ b/Application/Home/Controller/QueryController.class.php @@ -1830,6 +1830,7 @@ class QueryController extends BaseController $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(' * ') From e24550b993d2abb7a6f30e1f24800a32beb3a4c4 Mon Sep 17 00:00:00 2001 From: chenxiaojun <956334972@qq.com> Date: Thu, 21 Nov 2019 22:57:51 +0800 Subject: [PATCH 26/44] =?UTF-8?q?=E6=8E=A8=E5=B9=BF=E5=B9=B3=E5=8F=B0->?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E6=B1=87=E6=80=BB--bug=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controller/FinanceController.class.php | 18 ++++++++++++++++++ .../Home/Controller/QueryController.class.php | 14 +++++++------- .../View/default/Finance/withdrawRecord.html | 4 +++- 3 files changed, 28 insertions(+), 8 deletions(-) diff --git a/Application/Home/Controller/FinanceController.class.php b/Application/Home/Controller/FinanceController.class.php index 493ad6e6c..b783521f0 100644 --- a/Application/Home/Controller/FinanceController.class.php +++ b/Application/Home/Controller/FinanceController.class.php @@ -565,4 +565,22 @@ class FinanceController extends BaseController $this->assign('modelList', $modelList); $this->display(); } + + //审核拒绝 重新审核 + public function renewReview($id) + { + //是否是会长 + $this->purview(); + //验证安全密码 + $metaTitle = '结算明细'; + $modelList = ['财务管理', $metaTitle]; + $res = $this->verifyPasswordView($modelList, false); + if ($res == false) { + $data['status'] = 0; + $data['msg'] = '权限异常'; + $this->ajaxReturn($data); + } + + $id = intval($id); + } } \ No newline at end of file diff --git a/Application/Home/Controller/QueryController.class.php b/Application/Home/Controller/QueryController.class.php index 9bcdae958..bbbf0f56d 100644 --- a/Application/Home/Controller/QueryController.class.php +++ b/Application/Home/Controller/QueryController.class.php @@ -1733,7 +1733,7 @@ class QueryController extends BaseController $pagination = ''; $count = 0; if (intval($endTime - $begTime) / (24 * 3600) <= 31) { - $map[] = [ + $map = [ '_logic' => 'or', 'id' => $queryPromote['id'], 'chain' => ['like', $queryPromote['chain'] . $queryPromote['id'] . '/%'] @@ -1812,19 +1812,19 @@ class QueryController extends BaseController } } - $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'; + $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') + ->field('sum(uc.recharge_cost) cost') ->where($spendMap) ->buildSql(); $sqlCount = M('user_play_data_count', 'tab_')->alias('uc') - ->field('sum(uc . recharge_count) count') + ->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'))]]; + $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') + ->field('sum(uc.recharge_count) count') ->where($spendMap) ->buildSql(); $subQuery = M('user_play_info', 'tab_') diff --git a/Application/Home/View/default/Finance/withdrawRecord.html b/Application/Home/View/default/Finance/withdrawRecord.html index cd9515a2f..59b56dfb0 100644 --- a/Application/Home/View/default/Finance/withdrawRecord.html +++ b/Application/Home/View/default/Finance/withdrawRecord.html @@ -173,8 +173,10 @@ 提现明细 汇款证明 + + 重新审核 - 结算单 + 结算单 From 8fee02fc4c757e1497b7e910ed287e234576462c Mon Sep 17 00:00:00 2001 From: yulingwei <2436953959@qq.com> Date: Thu, 21 Nov 2019 23:12:24 +0800 Subject: [PATCH 27/44] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=97=B6=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Application/Admin/View/User/rolelist.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Application/Admin/View/User/rolelist.html b/Application/Admin/View/User/rolelist.html index d0adefd7d..bad81eab1 100644 --- a/Application/Admin/View/User/rolelist.html +++ b/Application/Admin/View/User/rolelist.html @@ -124,7 +124,7 @@ - + Date: Thu, 21 Nov 2019 23:14:54 +0800 Subject: [PATCH 28/44] =?UTF-8?q?=E6=8E=A8=E5=B9=BF=E5=B9=B3=E5=8F=B0->?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E6=B1=87=E6=80=BB--bug=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Application/Home/Controller/QueryController.class.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Application/Home/Controller/QueryController.class.php b/Application/Home/Controller/QueryController.class.php index bbbf0f56d..44958325c 100644 --- a/Application/Home/Controller/QueryController.class.php +++ b/Application/Home/Controller/QueryController.class.php @@ -1769,9 +1769,10 @@ class QueryController extends BaseController $map['promote_id'] = $queryPromote['id']; } - $roleIds = M('user_play_data_count', 'tab_')->group('role_id')->getField('role_id', true); - $map['role_id'] = ['in', $roleIds]; $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 != '') { From 0239a5f8e47b2ec23bb323ed2461a595821a0412 Mon Sep 17 00:00:00 2001 From: zhanglingsheng Date: Thu, 21 Nov 2019 23:20:27 +0800 Subject: [PATCH 29/44] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E8=BA=AB=E4=BB=BD?= =?UTF-8?q?=E8=AF=81=E8=AE=A4=E8=AF=81=E4=BF=A1=E6=81=AF=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E5=BA=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Data/update.sql | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/Data/update.sql b/Data/update.sql index c989c2a8c..ceea135f4 100644 --- a/Data/update.sql +++ b/Data/update.sql @@ -527,4 +527,17 @@ ALTER TABLE `tab_user_play_data_count` ADD INDEX `search`(`game_id`, `server_id`, `role_id`) USING BTREE, ADD INDEX `create_time`(`create_time`) USING BTREE; ADD INDEX `recharge_cost`(`recharge_cost`) USING BTREE, -ADD INDEX `recharge_count`(`recharge_count`) USING BTREE; \ No newline at end of file +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='身份证认证信息'; \ No newline at end of file From 710d7028f1770fcce720351248b3784edf0b440e Mon Sep 17 00:00:00 2001 From: ELF <360197197@qq.com> Date: Thu, 21 Nov 2019 23:26:24 +0800 Subject: [PATCH 30/44] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controller/PromoteController.class.php | 23 +++++++++++++++++-- .../Home/View/default/Promote/children.html | 10 ++++++++ 2 files changed, 31 insertions(+), 2 deletions(-) diff --git a/Application/Home/Controller/PromoteController.class.php b/Application/Home/Controller/PromoteController.class.php index ccfd6e84f..d3858aa4b 100644 --- a/Application/Home/Controller/PromoteController.class.php +++ b/Application/Home/Controller/PromoteController.class.php @@ -867,6 +867,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 +893,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 +903,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 +943,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); diff --git a/Application/Home/View/default/Promote/children.html b/Application/Home/View/default/Promote/children.html index 52e049283..d0a0eaef7 100644 --- a/Application/Home/View/default/Promote/children.html +++ b/Application/Home/View/default/Promote/children.html @@ -31,6 +31,16 @@ + +
+ +
+
From bd6932d8d44b8877a127bc9048742e6bd861278a Mon Sep 17 00:00:00 2001 From: chenxiaojun <956334972@qq.com> Date: Thu, 21 Nov 2019 23:38:13 +0800 Subject: [PATCH 31/44] =?UTF-8?q?=E6=8E=A8=E5=B9=BF=E5=B9=B3=E5=8F=B0->?= =?UTF-8?q?=E8=B4=A2=E5=8A=A1=E7=AE=A1=E7=90=86->=E6=8F=90=E7=8E=B0?= =?UTF-8?q?=E8=AE=B0=E5=BD=95--=E5=A2=9E=E5=8A=A0=E9=87=8D=E6=96=B0?= =?UTF-8?q?=E5=AE=A1=E6=A0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controller/FinanceController.class.php | 27 ++++++++++++++++-- .../View/default/Finance/withdrawRecord.html | 28 +++++++++++++++++-- 2 files changed, 51 insertions(+), 4 deletions(-) diff --git a/Application/Home/Controller/FinanceController.class.php b/Application/Home/Controller/FinanceController.class.php index b783521f0..605c26ad4 100644 --- a/Application/Home/Controller/FinanceController.class.php +++ b/Application/Home/Controller/FinanceController.class.php @@ -567,7 +567,7 @@ class FinanceController extends BaseController } //审核拒绝 重新审核 - public function renewReview($id) + public function renewReview() { //是否是会长 $this->purview(); @@ -581,6 +581,29 @@ class FinanceController extends BaseController $this->ajaxReturn($data); } - $id = intval($id); + $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); } } \ No newline at end of file diff --git a/Application/Home/View/default/Finance/withdrawRecord.html b/Application/Home/View/default/Finance/withdrawRecord.html index 59b56dfb0..03c52bf83 100644 --- a/Application/Home/View/default/Finance/withdrawRecord.html +++ b/Application/Home/View/default/Finance/withdrawRecord.html @@ -174,9 +174,9 @@ 汇款证明 - 重新审核 + 重新审核 - 结算单 + 结算单
@@ -269,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}); + } + }); + }); }); From 0d91f0aa5cf9c35aeea02e538af3c90566d5f52e Mon Sep 17 00:00:00 2001 From: ELF <360197197@qq.com> Date: Thu, 21 Nov 2019 23:42:53 +0800 Subject: [PATCH 32/44] =?UTF-8?q?=E4=BF=AE=E6=94=B9bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Home/Controller/SafeController.class.php | 31 ++----------------- .../Home/View/default/Safe/safeDocument.html | 20 +++--------- 2 files changed, 7 insertions(+), 44 deletions(-) diff --git a/Application/Home/Controller/SafeController.class.php b/Application/Home/Controller/SafeController.class.php index f411f529a..260dc2c8c 100644 --- a/Application/Home/Controller/SafeController.class.php +++ b/Application/Home/Controller/SafeController.class.php @@ -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]); - } } \ No newline at end of file diff --git a/Application/Home/View/default/Safe/safeDocument.html b/Application/Home/View/default/Safe/safeDocument.html index a2f05aaf3..3395e8ae0 100644 --- a/Application/Home/View/default/Safe/safeDocument.html +++ b/Application/Home/View/default/Safe/safeDocument.html @@ -51,7 +51,7 @@ and open the template in the editor.

游戏推广服务框架协议

本协议由以下双方于{$time}签订:

-

合同编号:{$code}

+

合同编号:{$sn}

甲方:海南万盟天下科技有限公司

注册地址:海南省海口市南海大道26号海口国家高新区创业孵化中心A楼5层A1-1268室

联系电话:13067391751

@@ -237,8 +237,6 @@ and open the template in the editor.
- -







@@ -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" + }); }) From 750cefcb543fc2c3d2ce5ed3155c8eee6f847400 Mon Sep 17 00:00:00 2001 From: sunke <18850253506@163.com> Date: Thu, 21 Nov 2019 23:43:46 +0800 Subject: [PATCH 33/44] =?UTF-8?q?=E5=85=85=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controller/DownloadController.class.php | 26 ++++++++++++------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/Application/Home/Controller/DownloadController.class.php b/Application/Home/Controller/DownloadController.class.php index a271b502a..8ffbd1820 100644 --- a/Application/Home/Controller/DownloadController.class.php +++ b/Application/Home/Controller/DownloadController.class.php @@ -2774,23 +2774,29 @@ class DownloadController extends BaseController { ->buildSql(); unset($map['begintime']); unset($map['endtime']); - $roles = M('user_play_info', 'tab_') - ->field("*,$sqlCost as cost,$sqlCount as count,$sqlTodayCost as today_cost") - ->where($map) - ->order('play_time desc') - ->select(); - foreach ($roles as $role) { + $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' => $role['user_account'], + 'user_account' => encryption($role['user_account']), 'game_name' => $role['game_name'], 'role_name' => $role['role_name'], 'role_id' => $role['role_id'], 'role_level' => $role['role_level'], 'server_id' => $role['server_id'], 'server_name' => $role['server_name'], - 'recharge_cost' => $role['cost'], - 'recharge_count' => $role['count'], - 'recharge_cost_today' => $role['cost_today'], + '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'], From 75b3b6899de01a72101c79215933b35726c07ec7 Mon Sep 17 00:00:00 2001 From: zhanglingsheng Date: Thu, 21 Nov 2019 23:57:13 +0800 Subject: [PATCH 34/44] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E8=BA=AB=E4=BB=BD?= =?UTF-8?q?=E8=AF=81=E8=AE=A4=E8=AF=81=E4=BF=A1=E6=81=AF=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E5=BA=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Data/update.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Data/update.sql b/Data/update.sql index ceea135f4..c12879640 100644 --- a/Data/update.sql +++ b/Data/update.sql @@ -536,7 +536,7 @@ CREATE TABLE `tab_idcard_log` ( `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 '错误次数', + `num` int(11) DEFAULT '1' COMMENT '认证次数', `status` tinyint(2) DEFAULT '0' COMMENT '0 认证失败 1 认证成功', `create_time` int(11) DEFAULT '0' COMMENT '创建时间', PRIMARY KEY (`id`) From 0b0570179841cb038dc7a2fb6f29d7dfd77b3217 Mon Sep 17 00:00:00 2001 From: zhengyongxing Date: Thu, 21 Nov 2019 23:59:00 +0800 Subject: [PATCH 35/44] =?UTF-8?q?=E6=8E=A8=E5=B9=BF=E5=91=98=E9=A6=96?= =?UTF-8?q?=E9=A1=B5=E7=BB=9F=E8=AE=A1=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controller/PromoteController.class.php | 166 +++++++++++------- .../Home/View/default/Promote/index.html | 10 +- 2 files changed, 104 insertions(+), 72 deletions(-) diff --git a/Application/Home/Controller/PromoteController.class.php b/Application/Home/Controller/PromoteController.class.php index d3858aa4b..0335835b6 100644 --- a/Application/Home/Controller/PromoteController.class.php +++ b/Application/Home/Controller/PromoteController.class.php @@ -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; $kfield(' + 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 = "") diff --git a/Application/Home/View/default/Promote/index.html b/Application/Home/View/default/Promote/index.html index eeeb5b479..0c550f33c 100644 --- a/Application/Home/View/default/Promote/index.html +++ b/Application/Home/View/default/Promote/index.html @@ -6,15 +6,15 @@
  • 推广总用户

    {$data.count}
  • -
  • 推广总充值

    ¥{$spendData.count}
  • -
  • 当日新增用户充值

    ¥{$todayAddSpendData.today}
  • -
  • 当月新增用户充值

    ¥{$mounthAddSpendData.mounth}
  • +
  • 推广总充值

    ¥{$spendData.sum_count}
  • +
  • 当日新增用户充值

    ¥{$todayAddSpendData.sum_today}
  • +
  • 当月新增用户充值

    ¥{$mounthAddSpendData.sum_mounth}
  • 昨日注册用户

    {$data.yesterday}
  • -
  • 昨日充值金额

    ¥{$yesterdaySpendData.count}
  • +
  • 昨日充值金额

    ¥{$spendData.yesterday}
  • 今日注册用户

    {$data.today}
  • -
  • 今日充值金额

    ¥{$spendData.today}
  • +
  • 今日充值金额

    ¥{$spendData.sum_today}
From a2dc77645f83a67b559313d7274d1beac8f4f52b Mon Sep 17 00:00:00 2001 From: chenxiaojun <956334972@qq.com> Date: Fri, 22 Nov 2019 00:06:07 +0800 Subject: [PATCH 36/44] =?UTF-8?q?=E6=8E=A8=E5=B9=BF=E5=B9=B3=E5=8F=B0->?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E7=AE=A1=E7=90=86--=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Application/Home/View/default/Query/userRoles.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Application/Home/View/default/Query/userRoles.html b/Application/Home/View/default/Query/userRoles.html index 5ceef8dfb..81e70c274 100644 --- a/Application/Home/View/default/Query/userRoles.html +++ b/Application/Home/View/default/Query/userRoles.html @@ -60,7 +60,7 @@
-
+
@@ -107,7 +107,7 @@
- 导出 + 导出 {$pagination}
From 623bc0d44f11af1747671d3a5a0036defcbb823a Mon Sep 17 00:00:00 2001 From: sunke <18850253506@163.com> Date: Fri, 22 Nov 2019 00:55:31 +0800 Subject: [PATCH 37/44] =?UTF-8?q?=E5=85=85=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Home/Controller/DownloadController.class.php | 16 +++++++++++----- .../Home/View/default/Query/userRecharges.html | 2 +- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/Application/Home/Controller/DownloadController.class.php b/Application/Home/Controller/DownloadController.class.php index 8ffbd1820..ce3fc9763 100644 --- a/Application/Home/Controller/DownloadController.class.php +++ b/Application/Home/Controller/DownloadController.class.php @@ -2728,15 +2728,21 @@ class DownloadController extends BaseController { ); $subMap = []; - $subMap['game_id'] = $map['game_id']; - $subMap['server_id'] = $map['server_id']; + 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']); - $roleIds = M('user_play_data_count', 'tab_')->group('role_id')->getField('role_id', true); + + $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]; - $subMap['create_time'] = ['between', [$map['begintime'], $map['endtime'] - 1]]; if ($costBegin != '' || $costEnd != '') { $having = ''; if ($costBegin != '' && $costEnd != '') { @@ -2767,7 +2773,7 @@ class DownloadController extends BaseController { ->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) diff --git a/Application/Home/View/default/Query/userRecharges.html b/Application/Home/View/default/Query/userRecharges.html index f09abebed..b760808bc 100644 --- a/Application/Home/View/default/Query/userRecharges.html +++ b/Application/Home/View/default/Query/userRecharges.html @@ -172,7 +172,7 @@
- 导出 + 导出 {$pagination}
From 80f76c4490d0834fc278b7f365d6e06199d09a29 Mon Sep 17 00:00:00 2001 From: chenxiaojun <956334972@qq.com> Date: Fri, 22 Nov 2019 01:04:21 +0800 Subject: [PATCH 38/44] =?UTF-8?q?=E6=8E=A8=E5=B9=BF=E5=B9=B3=E5=8F=B0->?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E7=AE=A1=E7=90=86--=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Base/Repository/UserRepository.class.php | 44 ++++++++++++++----- .../Home/Controller/QueryController.class.php | 2 +- .../Home/View/default/Query/userRoles.html | 4 +- 3 files changed, 36 insertions(+), 14 deletions(-) diff --git a/Application/Base/Repository/UserRepository.class.php b/Application/Base/Repository/UserRepository.class.php index 3e42e4052..e3ad78ade 100644 --- a/Application/Base/Repository/UserRepository.class.php +++ b/Application/Base/Repository/UserRepository.class.php @@ -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'); diff --git a/Application/Home/Controller/QueryController.class.php b/Application/Home/Controller/QueryController.class.php index 44958325c..4d0f5061b 100644 --- a/Application/Home/Controller/QueryController.class.php +++ b/Application/Home/Controller/QueryController.class.php @@ -1834,7 +1834,7 @@ class QueryController extends BaseController ->having('recharge_cost > 0') ->order('play_time desc') ->buildSql(); - $query = M()->field(' * ') + $query = M()->field('*') ->table($subQuery) ->alias('a') ->order($orderBy); diff --git a/Application/Home/View/default/Query/userRoles.html b/Application/Home/View/default/Query/userRoles.html index 5ceef8dfb..81e70c274 100644 --- a/Application/Home/View/default/Query/userRoles.html +++ b/Application/Home/View/default/Query/userRoles.html @@ -60,7 +60,7 @@ -
+
@@ -107,7 +107,7 @@
- 导出 + 导出 {$pagination}
From 36ff63bb3376c9e89c0c76e1cfe62639eee1c1a8 Mon Sep 17 00:00:00 2001 From: sunke <18850253506@163.com> Date: Fri, 22 Nov 2019 01:21:29 +0800 Subject: [PATCH 39/44] =?UTF-8?q?=E8=A7=92=E8=89=B2=E6=9F=A5=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Application/Home/Controller/DownloadController.class.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Application/Home/Controller/DownloadController.class.php b/Application/Home/Controller/DownloadController.class.php index ce3fc9763..53ac36fa6 100644 --- a/Application/Home/Controller/DownloadController.class.php +++ b/Application/Home/Controller/DownloadController.class.php @@ -1485,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]; @@ -1530,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']; @@ -1788,12 +1788,14 @@ class DownloadController extends BaseController { array('server_name','区服'), 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,role_name,role_level')->where($map)->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); From b1a870d7735928684aa7a72d4ac7715e04701560 Mon Sep 17 00:00:00 2001 From: sunke <18850253506@163.com> Date: Fri, 22 Nov 2019 01:26:56 +0800 Subject: [PATCH 40/44] =?UTF-8?q?=E6=8E=92=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Application/Home/Controller/DownloadController.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Application/Home/Controller/DownloadController.class.php b/Application/Home/Controller/DownloadController.class.php index 53ac36fa6..83bd739b8 100644 --- a/Application/Home/Controller/DownloadController.class.php +++ b/Application/Home/Controller/DownloadController.class.php @@ -1791,7 +1791,7 @@ class DownloadController extends BaseController { array('create_time','创建时间'), ); $model = M('user_play_info','tab_'); - $data = $model->field('user_account,promote_account,game_name,server_name,role_name,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']); From 0983eb633c8778382f7894cb5a9c5c3c521e6262 Mon Sep 17 00:00:00 2001 From: sunke <18850253506@163.com> Date: Fri, 22 Nov 2019 01:51:51 +0800 Subject: [PATCH 41/44] =?UTF-8?q?=E8=AE=BE=E5=A4=87=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Application/Home/Controller/DownloadController.class.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Application/Home/Controller/DownloadController.class.php b/Application/Home/Controller/DownloadController.class.php index 83bd739b8..1a464a126 100644 --- a/Application/Home/Controller/DownloadController.class.php +++ b/Application/Home/Controller/DownloadController.class.php @@ -1758,7 +1758,8 @@ 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','登陆时间'), @@ -1766,7 +1767,7 @@ class DownloadController extends BaseController { ); $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) { From df9d1415df197a475402aa65a1955717c3021b67 Mon Sep 17 00:00:00 2001 From: chenzhi <“chenzhi063@qq.com> Date: Fri, 22 Nov 2019 14:30:25 +0800 Subject: [PATCH 42/44] =?UTF-8?q?[=E4=BF=AE=E5=A4=8D]=E6=8E=A8=E5=B9=BF?= =?UTF-8?q?=E5=91=98=E5=85=85=E5=80=BC=E7=BB=9F=E8=AE=A1=E6=97=A0promote?= =?UTF-8?q?=5Fid=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Application/Admin/Controller/PlatformController.class.php | 2 ++ Application/Admin/View/Platform/promotepay_statistics.html | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Application/Admin/Controller/PlatformController.class.php b/Application/Admin/Controller/PlatformController.class.php index abaea3399..965da8b24 100644 --- a/Application/Admin/Controller/PlatformController.class.php +++ b/Application/Admin/Controller/PlatformController.class.php @@ -489,6 +489,7 @@ class PlatformController extends ThinkController ->where("pay_time".$pay_time) ->find(); $dbdata['promote_account'] = $promote[$i]['account']; + $dbdata['promote_id'] = $promote[$i]['id']; } else { $dbdata = $spend ->field(' @@ -500,6 +501,7 @@ class PlatformController extends ThinkController ->where("pay_time".$pay_time) ->find(); $dbdata['promote_account'] = $promote[$i]['account']; + $dbdata['promote_id'] = $promote[$i]['id']; } $data[] = $dbdata; } diff --git a/Application/Admin/View/Platform/promotepay_statistics.html b/Application/Admin/View/Platform/promotepay_statistics.html index 97b07c39c..a6dfd38e3 100644 --- a/Application/Admin/View/Platform/promotepay_statistics.html +++ b/Application/Admin/View/Platform/promotepay_statistics.html @@ -120,7 +120,7 @@
- + From 2123b2947991003e6d77e26f5373f37084ac7671 Mon Sep 17 00:00:00 2001 From: chenxiaojun <956334972@qq.com> Date: Fri, 22 Nov 2019 14:52:12 +0800 Subject: [PATCH 43/44] =?UTF-8?q?=E6=A0=B9=E6=8D=AE=E6=97=B6=E9=97=B4?= =?UTF-8?q?=E7=BB=9F=E8=AE=A1=E7=8E=A9=E5=AE=B6=E5=85=85=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Admin/Controller/AutoController.class.php | 26 ++++++++++++++++++ .../Home/Controller/QueryController.class.php | 27 ------------------- Data/update.sql | 2 +- 3 files changed, 27 insertions(+), 28 deletions(-) diff --git a/Application/Admin/Controller/AutoController.class.php b/Application/Admin/Controller/AutoController.class.php index 6ebe18b4b..b442ad320 100644 --- a/Application/Admin/Controller/AutoController.class.php +++ b/Application/Admin/Controller/AutoController.class.php @@ -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); + } } diff --git a/Application/Home/Controller/QueryController.class.php b/Application/Home/Controller/QueryController.class.php index 4d0f5061b..be50a7529 100644 --- a/Application/Home/Controller/QueryController.class.php +++ b/Application/Home/Controller/QueryController.class.php @@ -2134,31 +2134,4 @@ class QueryController extends BaseController $this->ajaxReturn($data); } - - public function userPlayDataCount() - { - $time = strtotime(date('Y-m-d 00:00:00', time() - (3600 * 24))); - $spendMap['pay_status'] = 1; - $spendMap['pay_game_status'] = 1; - $spendMap['game_player_id'] = ['gt', 0]; - $spendMap['pay_time'] = ['between', [$time, strtotime(date('Y-m-d 23:59:59', $time))]]; - - $field = 'FROM_UNIXTIME(pay_time, "%Y-%m-%d") as day,game_id,server_id,game_player_id,sum(pay_amount) as recharge_cost,count(id) as recharge_count'; - $spendCostData = M('spend', 'tab_')->field($field) - ->where($spendMap) - ->group('day,game_player_id,server_id,game_id') - ->select(); - - $data = []; - foreach ($spendCostData as $list) { - $save['game_id'] = $list['game_id']; - $save['server_id'] = $list['server_id']; - $save['role_id'] = $list['game_player_id']; - $save['recharge_cost'] = $list['recharge_cost']; - $save['recharge_count'] = $list['recharge_count']; - $save['create_time'] = strtotime($list['day']); - $data[] = $save; - } - M('user_play_data_count', 'tab_')->addAll($data); - } } diff --git a/Data/update.sql b/Data/update.sql index c989c2a8c..9bfad8b2e 100644 --- a/Data/update.sql +++ b/Data/update.sql @@ -524,7 +524,7 @@ CREATE TABLE `tab_user_play_data_count` ( ) ENGINE=InnoDB AUTO_INCREMENT=0 DEFAULT CHARSET=utf8; ALTER TABLE `tab_user_play_data_count` -ADD INDEX `search`(`game_id`, `server_id`, `role_id`) USING BTREE, +ADD INDEX `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; \ No newline at end of file From e0c0f50c7d29d43d38418716f8ac55f0dfcc30eb Mon Sep 17 00:00:00 2001 From: chenxiaojun <956334972@qq.com> Date: Fri, 22 Nov 2019 15:04:42 +0800 Subject: [PATCH 44/44] =?UTF-8?q?=E5=88=86=E6=88=90=E6=AF=94=E4=BE=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Application/Common/Common/extend.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Application/Common/Common/extend.php b/Application/Common/Common/extend.php index 6f38130b5..8ed98c5b7 100644 --- a/Application/Common/Common/extend.php +++ b/Application/Common/Common/extend.php @@ -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']; } /**
{$data.play_time|date='Y-m-d H:i:s',###}{$data.create_time|date='Y-m-d H:i:s',###} {$data.user_account}
{$data['promote_account']}{$data.count}{$data.count} {$data.today} {$data.week}