From ff2481cdc415061e6ff9c3ef877f7ff3801b1dff Mon Sep 17 00:00:00 2001 From: chenxiaojun <956334972@qq.com> Date: Wed, 11 Dec 2019 11:27:12 +0800 Subject: [PATCH 01/10] =?UTF-8?q?=E6=8E=A8=E5=B9=BF=E5=B9=B3=E5=8F=B0>?= =?UTF-8?q?=E8=90=BD=E5=9C=B0=E9=A1=B5>=E5=AE=89=E5=8D=93=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E8=A7=86=E9=A2=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Home/View/default/Home/landingPage2.html | 32 ++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/Application/Home/View/default/Home/landingPage2.html b/Application/Home/View/default/Home/landingPage2.html index 9b9c9e634..006f0cce6 100644 --- a/Application/Home/View/default/Home/landingPage2.html +++ b/Application/Home/View/default/Home/landingPage2.html @@ -17,6 +17,27 @@ + @@ -33,12 +54,21 @@
- + +
+ + +
+ +
+ + +
From ad97083c9f93ee6f0343e7ad5ebfcc29991ccfc6 Mon Sep 17 00:00:00 2001 From: zhanglingsheng Date: Wed, 11 Dec 2019 15:21:37 +0800 Subject: [PATCH 02/10] =?UTF-8?q?=E8=A1=8C=E4=B8=BA=E6=97=A5=E5=BF=97?= =?UTF-8?q?=E6=96=87=E6=A1=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Application/Admin/View/BehaviorLog/index.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Application/Admin/View/BehaviorLog/index.html b/Application/Admin/View/BehaviorLog/index.html index 0ee33fb7f..446c5a642 100644 --- a/Application/Admin/View/BehaviorLog/index.html +++ b/Application/Admin/View/BehaviorLog/index.html @@ -29,8 +29,8 @@
From 387fe5c007695a5f5398ab1dbbfafb5b920699d3 Mon Sep 17 00:00:00 2001 From: zhanglingsheng Date: Wed, 11 Dec 2019 15:30:45 +0800 Subject: [PATCH 03/10] =?UTF-8?q?=E6=94=AF=E4=BB=98=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=AD=97=E6=AE=B5?= 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 4c9cac958..71a494b3a 100644 --- a/Data/update.sql +++ b/Data/update.sql @@ -693,6 +693,6 @@ ALTER TABLE `tab_pay_info` ADD COLUMN `game_name` varchar(30) DEFAULT '' COMMENT ALTER TABLE `tab_pay_info` ADD COLUMN `server_id` int(11) DEFAULT '0' COMMENT '区服id'; ALTER TABLE `tab_pay_info` ADD COLUMN `server_name` varchar(30) DEFAULT '' COMMENT '区服名称'; ALTER TABLE `tab_pay_info` ADD COLUMN `promote_id` int(11) NOT NULL DEFAULT '0' COMMENT '推广员id'; -ALTER TABLE `tab_pay_info` ADD COLUMN `game_player_id` int(11) DEFAULT '0' COMMENT '玩家游戏内id'; +ALTER TABLE `tab_pay_info` ADD COLUMN `game_player_id` varchar(30) DEFAULT '0' COMMENT '玩家游戏内id'; ALTER TABLE `tab_pay_info` ADD COLUMN `sdk_version` tinyint(2) DEFAULT '1' COMMENT '区别sdk版本1安卓 2苹果 '; ALTER TABLE `tab_pay_info` ADD COLUMN `promote_account` varchar(30) DEFAULT '' COMMENT '推广员账号'; From 98f7653f2abb988901b81a2a6fbb8446e497e916 Mon Sep 17 00:00:00 2001 From: liuweiwen <“529520975@qq.com> Date: Wed, 11 Dec 2019 15:44:58 +0800 Subject: [PATCH 04/10] =?UTF-8?q?pc=E5=AE=98=E7=BD=91-=E3=80=8B=E5=AE=B6?= =?UTF-8?q?=E9=95=BF=E7=9B=91=E6=8A=A4-=E3=80=8B=E6=9B=B4=E6=8D=A2?= =?UTF-8?q?=E5=AE=B6=E9=95=BF=E7=9B=91=E6=8A=A4=E5=BC=95=E5=AF=BC=E5=86=85?= =?UTF-8?q?=E5=AE=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../View/default/Article/article/detail1.html | 41 ++++++++++++++----- 1 file changed, 31 insertions(+), 10 deletions(-) diff --git a/Application/Media/View/default/Article/article/detail1.html b/Application/Media/View/default/Article/article/detail1.html index b32639c92..54b746cfa 100644 --- a/Application/Media/View/default/Article/article/detail1.html +++ b/Application/Media/View/default/Article/article/detail1.html @@ -70,7 +70,7 @@
  • 监护工程概述
  • 申请服务流程
  • -
  • 介绍详细说明
  • +
  • 家长监护申请引导
  • 健康提示
  • 纠纷处理
  • @@ -121,15 +121,36 @@
    -
    介绍详细说明
    -

    网络游戏未成年人家长监护工程”是一项由文化部指导,义乌市其豪网络科技有限公司旨在加强家长对未成年人参与网络游戏的监护,引导未成年人健康、绿色参与网络游戏,和谐家庭关系的行业自律行动。

    -

    2010年2月5日,首批试点的六家企业共同启动“监护工程”,开始了游戏企业与未成年人家长联合共同预防未成年人沉迷网络游戏的有益尝试。实践中一些成功的案例让我们看到 “监护工程”提供了一种切实可行的方法,一种家长实施监控的管道,使家长纠正部分未成年子女沉迷网游成为可能。

    -

    “监护工程”引导家长和未成年人正确面对网络游戏文化,加强相互沟通,在共同约定和认可的时间或规则下健康游戏,既保护了未成年人不受过度沉迷的伤害,也为家长指导未成年人健康游戏提供了有力的技术保障。

    -

    其豪网络科技有限公司已贯彻实施“家长监护工程”的四项具体要求,即专人负责、有专线电话、有专区设置、有季度报告。

    -

    (一)专人负责

    -

    1.已指定专门的负责人,已将指定负责人及联络方式向海南省文化厅备案;

    -

    2.培训专门服务人员对“家长监护工程”提供专业咨询解答和服务支持;帮助家长了解被监护人游戏行为,提供家长与被监护人进行沟通的建议;

    -

    3.指定客服人员会定期跟踪、与家长沟通。如若家长有需要帮助,负责人会根据实际的情况提供相应的协助。

    +
    家长监护申请引导
    +
    +

    “网络游戏未成年人家长监护工程”是一项由聚侠网根据国家有关规定而发起的一个项目,旨在加强家长对未成年人参与网络游戏的监护,引导未成年人健康、绿色参与网络游戏,和谐家庭关系的社会性公益行动。它提供了一种切实可行的方法,一种家长实施监控的管道,使家长纠正部分未成年子女沉迷游戏的行为成为可能。该项社会公益行动充分反映了中国网络游戏行业高度的社会责任感,对未成年玩家合法权益的关注及对用实际行动营造和谐社会的愿望。

    +

    具体实施细则如下:

    + +

    申请条件:

    +

    1、 申请人需为被监护未成年人的法定监护人;

    +

    2、 申请人的被监护人年龄小于18周岁;

    +

    3、 申请人需为大陆公民,不含港、澳、台人士。

    +

    申请需提交材料:(点击下载申请表格)

    +

    1、监护人信息表(包含监护人的身份证明复印件);

    +

    2、被监护人信息表(包含被监护人所玩游戏相关信息及身份证明复印件);

    +

    3、填写网络游戏未成年人家长监护申请书、保证书、授权书并手工签字(需下载,填写并打印,签字);

    +

    4、申请人与被监护人的监护关系证明文件(户口簿或有关机关出具的证明文件)。

    + +

    申请方式:

    +

    1.电话服务 监护人可以通过来专线电话来咨询,专线:0793-8179522

    +

    2.传真服务 监护人可以通过传真发送相关信息,进行申请,传真号码:0793-8179533

    +

    3.邮寄服务 监护人可以通过邮寄提交相关信息,邮寄地址:江西省上饶市信州区三清山东大道168号数字经济服务园9楼站群一部

    + +

    其他要求:

    +

    1.申请人应提交较完备的申请材料,对未提供的信息要及时补充;可请熟知电脑、互联网、游戏的人员进行协助,以便提供详实资料;

    +

    2.申请人应保证提交的信息真实有效;对于提供虚假信息或伪造证件,我司将保留进一步追究法律责任的权利。

    + + +

    监督方式:

    +

    封停账号

    +

    根据监护人意愿封停被监护人账号。直至被监护人年满18周岁,并提出申请。

    + +
    From 49408030f0000ee545d6ed38024ab1953d3f2022 Mon Sep 17 00:00:00 2001 From: sunke <18850253506@163.com> Date: Wed, 11 Dec 2019 15:57:36 +0800 Subject: [PATCH 05/10] =?UTF-8?q?=E8=A1=8C=E4=B8=BA=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controller/DownloadController.class.php | 139 +++++++ .../Controller/PlayersController.class.php | 133 +++++++ .../Home/View/default/Players/playAction.html | 352 ++++++++++++++++++ .../View/default/Public/promote_base.html | 17 +- 4 files changed, 629 insertions(+), 12 deletions(-) create mode 100644 Application/Home/Controller/PlayersController.class.php create mode 100644 Application/Home/View/default/Players/playAction.html diff --git a/Application/Home/Controller/DownloadController.class.php b/Application/Home/Controller/DownloadController.class.php index b19f68679..45a84c811 100644 --- a/Application/Home/Controller/DownloadController.class.php +++ b/Application/Home/Controller/DownloadController.class.php @@ -1133,6 +1133,83 @@ class DownloadController extends BaseController { } $this->success('添加下载成功',U('listsIndex')); } + + public function players_data_export() { + $begTime = I('begtime'); + $endTime = I('endtime'); + $map1['chain'] = ['like','%'.'/'.PID.'/'.'%']; + $rs = M('promote','tab_')->where($map1)->field('id,account,nickname')->select(); + $childPromoteIds = ''; + if(empty($rs)) { + $map['tab_pay_info.promote_id'] = PID; + }else { + foreach ($rs as $rsKey => $rsValue) { + $id = $rsValue['id']; + $childPromoteIds .= $id.','; + } + $childPromoteIds = rtrim($childPromoteIds, ','); + $childPromoteIds .= ',' . PID; + $map['tab_pay_info.promote_id'] = ['in', $childPromoteIds]; + } + + $levelPromote = $this->getLevelPromote(); + $queryPromote = $this->getQueryPromote($levelPromote); + $map2[] = [ + '_logic' => 'or', + 'id' => $queryPromote['id'], + 'chain' => ['like', $queryPromote['chain'] . $queryPromote['id'] . '/%'] + ]; + $ids = M('promote', 'tab_')->where($map2)->getField('id', true); + if(empty($ids)) { + $ids = array(); + } + if(empty($levelPromote)) { + array_push($ids,PID); + + } + array_push($ids,$queryPromote['id']); + if (!empty($ids)) { + $map['tab_pay_info.promote_id'] = ['in',$ids]; + + }else { + $map['_string'] = '1<>1'; + } + + empty(I('relation_game_id')) || $map['tab_pay_info.relation_game_id'] = I('relation_game_id'); + empty(I('sdk_version')) || $map['tab_pay_info.sdk_version'] = I('sdk_version'); + empty(I('server_id')) || $map['tab_pay_info.server_id'] = I('server_id'); + empty(I('game_player_name')) || $map['tab_pay_info.game_player_name'] = ['like', '%' . I('game_player_name') . '%']; + empty(I('user_account')) || $map['tab_pay_info.user_account'] = ['like', '%' . I('user_account') . '%']; + empty(I('extend')) || $map['tab_pay_info.extend'] = I('extend'); + empty(I('user_id')) || $map['tab_pay_info.user_id'] = I('user_id'); + if (!empty($begTime) && !empty($endTime)) { + $map['tab_pay_info.create_time'] = ['between', [strtotime($begTime), strtotime($endTime) - 1]]; + }else if (empty($begTime) && !empty($endTime)) { + $map['tab_pay_info.create_time'] = ['elt',strtotime($endTime)]; + }else if (!empty($begTime) && empty($endTime)) { + $map['tab_pay_info.create_time'] = ['EGT',strtotime($begTime)]; + } + + $conditions = json_encode($map,TRUE); + $addtime = time(); + $data = [ + 'logid' => 'players_'.time(), + 'promote_id' => PID, + 'type' => '/Home/Players/playaction', + 'dataname' => '玩家行为日志', + 'status' => 0, + 'addtime' => $addtime, + 'begintime' => 0, + 'content' => '', + 'conditions' =>$conditions + ]; + $res = M('downloadlog','tab_')->add($data); + if (!$res) { + // $this->ajaxReturn(array("status" => -1, "msg" => "添加导出日志失败", 'ret' => $res)); + $this->error('添加下载失败'); + } + $this->success('添加下载成功',U('listsIndex')); + } /** * 充值明细添加下载 * @author sunke @@ -1761,11 +1838,73 @@ class DownloadController extends BaseController { case "平台币充值": $this->orderlistExcelInfo($id,$map); break; + case "玩家行为日志"; + $this->playactionExcelInfo($id,$map); + break; default: break; } } + + public function playactionExcelInfo($id,$map) { + $xlsName = "玩家行为日志"; + $xlsCell = array( + 'cp订单号', + '充值时间', + '玩家账号', + '游戏名称', + '所属推广员', + '游戏区服', + '角色ID', + '角色名称', + '订单金额' + ); + $model = M('pay_info','tab_'); + $data1 = $model->field('id')->where($map)->select(); + $csvFileName = $xlsName.'.csv'; + //设置好告诉浏览器要下载excel文件的headers + header('Content-Description: File Transfer'); + header('Content-Type: application/vnd.ms-excel'); + header('Content-Disposition: attachment; filename="'. $csvFileName .'"'); + header('Expires: 0'); + header('Cache-Control: must-revalidate'); + header('Pragma: public'); + $fp = fopen('php://output', 'a');//打开output流 + mb_convert_variables('gb2312', 'UTF-8', $xlsCell); + fputcsv($fp, $xlsCell);//将数据格式化为CSV格式并写入到output流中 + $accessNum = '100000';//从数据库获取总量,假设是十万 + $accessNum = count($data1)?:0 ; + + $perSize = 5000;//每次查询的条数 + $pages = ceil($accessNum / $perSize); + for($i = 1; $i <= $pages; $i++) { + $data = $model->where($map)->order('tab_pay_info.create_time desc') + ->limit(($i-1)*$perSize ,$perSize)->select(); + foreach($data as $key => $v) { + $v['create_time'] = date('Y-m-d H:i:s',$v['create_time']); + $promoteInfo = M('promote','tab_')->field("nickname")->where(['id' => intval($v['promote_id'])])->find(); + $v['promote_id']= $promoteInfo['nickname']; + $csvData['extend'] = $this->encryption($v['extend']); + $csvData['create_time'] = $v['create_time']; + $csvData['user_account'] = $v['user_account']; + $csvData['game_name'] = $v['game_name']; + $csvData['promote_id'] = $v['promote_id']; + $csvData['server_name'] = $v['server_name']; + $csvData['user_id'] = $v['user_id']; + $csvData['game_player_name'] = $v['game_player_name']; + $csvData['price'] = $v['price']; + mb_convert_variables('GBK', 'UTF-8', $csvData); + fputcsv($fp, $csvData); + } + unset($csvData); + ob_flush(); + flush(); + } + fclose($fp); + $this->backSuccessExport($id); + + } //注册明细excel信息 public function registerExcelInfo($id,$map) { diff --git a/Application/Home/Controller/PlayersController.class.php b/Application/Home/Controller/PlayersController.class.php new file mode 100644 index 000000000..427ae9b5a --- /dev/null +++ b/Application/Home/Controller/PlayersController.class.php @@ -0,0 +1,133 @@ +getLevelPromote(); + $queryPromote = $this->getQueryPromote($levelPromote); + // $loginPromote = $this->getLoginPromote(); + $map = []; + + $map['chain'] = ['like', $queryPromote['chain'] . $queryPromote['id'] . '/%']; + $ids = M('promote', 'tab_')->where($map)->getField('id', true); + $ids[] = $queryPromote['id']; + $map = []; + $map['tab_pay_info.promote_id'] = ['in', $ids]; + + if (!empty($relationGameId)) { + $map['tab_pay_info.relation_game_id'] = $relationGameId; + } + if (!empty($sdkVersion)) { + $map['tab_pay_info.sdk_version'] = $sdkVersion; + } + if (!empty($serverId)) { + $map['tab_pay_info.server_id'] = $serverId; + } + if (!empty($gamePlayerName)) { + $map['tab_pay_info.game_player_name'] = $gamePlayerName; + } + if (!empty($userAccount)) { + $map['tab_pay_info.user_account'] = $userAccount; + } + if (!empty($extend)) { + $map['tab_pay_info.extend'] = $extend; + } + if (!empty($userId)) { + $map['tab_pay_info.user_id'] = $userId; + } + if (!empty($begTime) && !empty($endTime)) { + $map['tab_pay_info.create_time'] = ['between', [$begTime, $endTime - 1]]; + }else if (empty($begTime) && !empty($endTime)) { + $map['tab_pay_info.create_time'] = ['elt',$endTime]; + }else if (!empty($begTime) && empty($endTime)) { + $map['tab_pay_info.create_time'] = ['EGT',$begTime]; + } + $page = intval(I('get.p', 1)); + $page = $page ? $page : 1; //默认显示第一页数据arraypage + $row=10; + $rs = M('pay_info','tab_')->where($map)->order('tab_pay_info.create_time desc') + ->page($page, $row)->select(); + foreach($rs as $key => $v) { + $rs[$key]['extend'] = encryption($v['extend']); + $rs[$key]['create_time'] = date('Y-m-d H:i:s',$v['create_time']); + $promoteInfo = M('promote','tab_')->field("nickname")->where(['id' => intval($v['promote_id'])])->find(); + $rs[$key]['promote_id']= $promoteInfo['nickname']; + } + $count = M('pay_info', 'tab_') + ->field('tab_pay_info.id') + ->where($map) + ->select(); + $count = count($count); + + //分页 + $parameter['p'] = $page; + $parameter['row'] = $row; + $parameter['begtime'] = $initBegTime; + $parameter['endtime'] = $initEndTime; + $parameter['relation_game_id'] = $relationGameId; + $parameter['sdk_version'] = $sdkVersion; + $parameter['server_id'] = $serverId; + $parameter['game_player_name'] = $gamePlayerName; + $parameter['user_account'] = $userAccount; + $parameter['extend'] = $extend; + $parameter['user_id'] = $user_id; + $parameter['level_promote_2'] = $levelPromote[0]; + $parameter['level_promote_3'] = $levelPromote[1]; + $parameter['level_promote_4'] = $levelPromote[2]; + $page = set_pagination($count, $row, $parameter); + if ($page) { + $this->assign('_page', $page); + } + $this->assign('listData',$rs); + $this->assign('initBegTime', I('begtime')); + $this->assign('initEndTime', I('endtime')); + $this->display(); + } + + private function getLevelPromote() + { + $levelPromote = []; + $levelPromote[] = I('level_promote_2', 0); + $levelPromote[] = I('level_promote_3', 0); + $levelPromote[] = I('level_promote_4', 0); + return $levelPromote; + } + + private function getQueryPromote($levelPromote) + { + $queryPromote = null; + $promote = $this->getLoginPromote(); + $queryPromoteId = 0; + foreach ($levelPromote as $item) { + if ($item != 0) { + $queryPromoteId = $item; + } + } + if ($queryPromoteId == 0) { + $queryPromote = $this->getLoginPromote(); + } else { + $queryPromote = M('promote', 'tab_')->where(['id' => $queryPromoteId])->find(); + } + return $queryPromote; + } +} \ No newline at end of file diff --git a/Application/Home/View/default/Players/playAction.html b/Application/Home/View/default/Players/playAction.html new file mode 100644 index 000000000..c3b1f63f1 --- /dev/null +++ b/Application/Home/View/default/Players/playAction.html @@ -0,0 +1,352 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Application/Home/View/default/Public/promote_base.html b/Application/Home/View/default/Public/promote_base.html index cd8f6eab3..1e53ffa9a 100644 --- a/Application/Home/View/default/Public/promote_base.html +++ b/Application/Home/View/default/Public/promote_base.html @@ -127,18 +127,11 @@ 平台币充值
    - - - - - - - - - - - - + + + From b27906d470780a3096f704131f28a4cabd21be0c Mon Sep 17 00:00:00 2001 From: chenxiaojun <956334972@qq.com> Date: Wed, 11 Dec 2019 16:13:37 +0800 Subject: [PATCH 06/10] =?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>=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 --- .../Admin/Controller/AutoController.class.php | 61 +++++++++++++++++++ .../Home/Controller/QueryController.class.php | 14 ++++- .../Home/View/default/Home/landingPage2.html | 6 +- .../View/default/Query/userRecharges.html | 24 ++++++++ Data/update.sql | 13 ++++ 5 files changed, 110 insertions(+), 8 deletions(-) diff --git a/Application/Admin/Controller/AutoController.class.php b/Application/Admin/Controller/AutoController.class.php index c704aec94..31037e19a 100644 --- a/Application/Admin/Controller/AutoController.class.php +++ b/Application/Admin/Controller/AutoController.class.php @@ -1034,4 +1034,65 @@ public function auto_rrdae(){ ]; return $ret; } + + //玩家角色每日登录记录 + public function userPlayLoginRecordByDayCount($time = '') + { + if ($time == '') { + $time = strtotime(date('Y-m-d 00:00:00', time() - (3600 * 24))); + } else { + $time = strtotime(date('Y-m-d 00:00:00', strtotime($time))); + } + $res = M('user_play_login_record_by_day', 'tab_')->where(array('create_time' => $time))->find(); + if (empty($res)) { + $map['login_time'] = ['between', [$time, strtotime(date('Y-m-d 23:59:59', $time))]]; + + $this->userPlayLoginRecordByDayByMap($map); + } + } + + //玩家角色每日登录记录--初始化 + public function userPlayLoginRecordByDayInitial() + { + $res = M('user_play_login_record_by_day', 'tab_')->order('id asc')->find(); + if (empty($res)) { + ini_set('memory_limit','800M'); + $time = strtotime(date('Y-m-d 00:00:00', time())); + $map['login_time'] = ['lt', $time]; + + $this->userPlayLoginRecordByDayByMap($map); + echo '初始化成功'; + } else { + echo '表存在记录,无法初始化'; + } + } + + //玩家角色每日登录记录 + private function userPlayLoginRecordByDayByMap($map = []) + { + if (isset($map['login_time'])) { + $map['game_id'] = ['gt', 0]; + $field = 'FROM_UNIXTIME(login_time, "%Y-%m-%d") as day,user_id,game_id'; + $loginData = M('user_game_login_record', 'tab_')->field($field) + ->where($map) + ->group('day,game_id,user_id') + ->select(); + + if (!empty($loginData)) { + $data = []; + foreach ($loginData as &$list) { + $data[] = [ + 'user_id' => $list['user_id'], + 'game_id' => $list['game_id'], + 'server_id' => '', + 'role_id' => '', + 'create_time' => strtotime($list['day']), + ]; + unset($list); + } + unset($loginData); + M('user_play_login_record_by_day', 'tab_')->addAll($data); + } + } + } } diff --git a/Application/Home/Controller/QueryController.class.php b/Application/Home/Controller/QueryController.class.php index 3cb662551..b667996d0 100644 --- a/Application/Home/Controller/QueryController.class.php +++ b/Application/Home/Controller/QueryController.class.php @@ -1759,7 +1759,7 @@ class QueryController extends BaseController $lastSortName = trim(I('last_sort_name', '')); $sortName = trim(I('sort_name', '')); $sort = intval(I('sort', 1)); - $sortNameData = ['recharge_cost', 'recharge_count', 'recharge_cost_today', 'unlogin_day']; + $sortNameData = ['recharge_cost', 'recharge_count', 'recharge_cost_today', 'unlogin_day', 'create_time', 'user_game_login_count']; $nowTime = date('Y-m-d', time() - 3600 * 24); $initBegTime = date('Y-m-d', strtotime('-6 day', strtotime($nowTime))); $initBegTime = empty(I('begtime')) ? $initBegTime : I('begtime'); @@ -1855,8 +1855,15 @@ class QueryController extends BaseController $map['uc.create_time'] = ['between', [$begTime, $endTime - 1]]; $fieldUC = "sum(uc.recharge_cost) recharge_cost,sum(uc.recharge_count) recharge_count,sum(if(uc.create_time = {$nowTime},uc.recharge_cost,0)) as recharge_cost_today"; - $fieldUI = "ui.user_account,ui.game_name,ui.role_name,ui.role_level,ui.server_name,ui.play_time,ui.play_ip,ui.promote_account,ui.sdk_version"; - $field = $fieldUC . ',' . $fieldUI; + $fieldUI = "ui.user_account,ui.game_name,ui.role_name,ui.role_level,ui.server_name,ui.play_time,ui.play_ip,ui.promote_account,ui.sdk_version,ui.create_time"; + + $loginRecordMap['lr.create_time'] = $map['uc.create_time']; + $loginRecordMap['_string'] = 'lr.user_id = uc.user_id and lr.game_id = uc.game_id'; + $fieldLR = M('user_play_login_record_by_day', 'tab_')->alias('lr') + ->field("count(*) as count") + ->where($loginRecordMap) + ->buildSql(); + $field = $fieldUC . ',' . $fieldUI . ',' . $fieldLR . ' as user_game_login_count'; $subQuery = M('user_play_data_count', 'tab_')->alias('uc') ->field($field) ->join('left join tab_user_play_info as ui on ui.user_id = uc.user_id and ui.game_id = uc.game_id and ui.server_id = uc.server_id and ui.role_id = uc.role_id') @@ -1883,6 +1890,7 @@ class QueryController extends BaseController $list['role_level'] = empty($list['role_level']) ? '--' : $list['role_level']; $list['unlogin_day'] = empty($list['play_time']) ? '--' : intval((strtotime(date('Y-m-d 00:00:00')) - strtotime(date('Y-m-d 00:00:00', $list['play_time']))) / (24 * 3600)); $list['play_time'] = empty($list['play_time']) ? '--' : date('Y-m-d H:i:s', $list['play_time']); + $list['create_time'] = empty($list['create_time']) ? '--' : date('Y-m-d H:i:s', $list['create_time']); $list['promote_account'] = empty($list['promote_account']) ? '--' : $list['promote_account']; } } diff --git a/Application/Home/View/default/Home/landingPage2.html b/Application/Home/View/default/Home/landingPage2.html index 006f0cce6..ff3b72c39 100644 --- a/Application/Home/View/default/Home/landingPage2.html +++ b/Application/Home/View/default/Home/landingPage2.html @@ -26,17 +26,13 @@ .home-video video { margin-left: 0.45%; width: 84.75%; + border-radius: 4.5%; } @media(min-width:580px){ .home-video { max-width:580px; } } - @media(min-height:580px){ - .home-video { - max-width:580px; - } - } diff --git a/Application/Home/View/default/Query/userRecharges.html b/Application/Home/View/default/Query/userRecharges.html index fbc9d3f99..007453957 100644 --- a/Application/Home/View/default/Query/userRecharges.html +++ b/Application/Home/View/default/Query/userRecharges.html @@ -145,6 +145,28 @@ + 玩家游戏累计登录天数 + + + + + + + + + + + 注册时间 + + + + + + + + + + 最后登录时间 推广员账号 @@ -163,6 +185,8 @@ {$record.recharge_count} {$record.recharge_cost_today} {$record.unlogin_day} + {$record.user_game_login_count} + {$record.create_time} {$record.play_time} {$record.promote_account} diff --git a/Data/update.sql b/Data/update.sql index c365cc758..9e638d22b 100644 --- a/Data/update.sql +++ b/Data/update.sql @@ -656,3 +656,16 @@ ALTER TABLE tab_game ADD `supersign_status` tinyint(1) DEFAULT '1' COMMENT '超 -- 新旧IOS打包标识 ALTER TABLE `tab_game_source` add COLUMN `is_new_sdk` tinyint(2) DEFAULT '0' COMMENT '是否新SDK(IOS)'; + +--2019-12-11 cxj +--玩家角色每日登录记录表 +CREATE TABLE `tab_user_play_login_record_by_day` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `user_id` int(11) NOT NULL DEFAULT 0 COMMENT '玩家id', + `game_id` int(11) NOT NULL DEFAULT 0 COMMENT '游戏id', + `server_id` varchar(30) NOT NULL DEFAULT '' COMMENT '区服id', + `role_id` varchar(30) NOT NULL DEFAULT '' COMMENT '角色id', + `create_time` int(10) NOT NULL DEFAULT 0 COMMENT '创建时间', + PRIMARY KEY (`id`), + INDEX `search`(`user_id`, `game_id`, `create_time`) USING BTREE +); \ No newline at end of file From 701bb6a8189e8cb57fa022c7f09c15fcc174c7ce Mon Sep 17 00:00:00 2001 From: zhanglingsheng Date: Wed, 11 Dec 2019 16:14:37 +0800 Subject: [PATCH 07/10] =?UTF-8?q?sql=E6=B7=BB=E5=8A=A0=E8=A1=8C=E4=B8=BA?= =?UTF-8?q?=E6=97=A5=E5=BF=97=E8=8F=9C=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Data/update.sql | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Data/update.sql b/Data/update.sql index 71a494b3a..c47374790 100644 --- a/Data/update.sql +++ b/Data/update.sql @@ -696,3 +696,5 @@ ALTER TABLE `tab_pay_info` ADD COLUMN `promote_id` int(11) NOT NULL DEFAULT '0' ALTER TABLE `tab_pay_info` ADD COLUMN `game_player_id` varchar(30) DEFAULT '0' COMMENT '玩家游戏内id'; ALTER TABLE `tab_pay_info` ADD COLUMN `sdk_version` tinyint(2) DEFAULT '1' COMMENT '区别sdk版本1安卓 2苹果 '; ALTER TABLE `tab_pay_info` ADD COLUMN `promote_account` varchar(30) DEFAULT '' COMMENT '推广员账号'; +-- 菜单(游戏充值预下单) +INSERT INTO `platform`.`sys_menu`(`title`, `pid`, `sort`, `url`, `hide`, `tip`, `group`, `is_dev`, `status`) VALUES ('游戏充值预下单', 16, 0, 'BehaviorLog/game', 0, '', '行为日志', 0, 1); \ No newline at end of file From 8a1a65c77126eb03f996db87ff953f7da45467d7 Mon Sep 17 00:00:00 2001 From: zhanglingsheng Date: Wed, 11 Dec 2019 16:15:15 +0800 Subject: [PATCH 08/10] =?UTF-8?q?sql=E6=B7=BB=E5=8A=A0=E8=A1=8C=E4=B8=BA?= =?UTF-8?q?=E6=97=A5=E5=BF=97=E8=8F=9C=E5=8D=95?= 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 c47374790..ec8fee41a 100644 --- a/Data/update.sql +++ b/Data/update.sql @@ -697,4 +697,4 @@ ALTER TABLE `tab_pay_info` ADD COLUMN `game_player_id` varchar(30) DEFAULT '0' C ALTER TABLE `tab_pay_info` ADD COLUMN `sdk_version` tinyint(2) DEFAULT '1' COMMENT '区别sdk版本1安卓 2苹果 '; ALTER TABLE `tab_pay_info` ADD COLUMN `promote_account` varchar(30) DEFAULT '' COMMENT '推广员账号'; -- 菜单(游戏充值预下单) -INSERT INTO `platform`.`sys_menu`(`title`, `pid`, `sort`, `url`, `hide`, `tip`, `group`, `is_dev`, `status`) VALUES ('游戏充值预下单', 16, 0, 'BehaviorLog/game', 0, '', '行为日志', 0, 1); \ No newline at end of file +INSERT INTO `sys_menu`(`title`, `pid`, `sort`, `url`, `hide`, `tip`, `group`, `is_dev`, `status`) VALUES ('游戏充值预下单', 16, 0, 'BehaviorLog/game', 0, '', '行为日志', 0, 1); \ No newline at end of file From 0a7973ae3c1be42164794fa4e5819f8904ac623f Mon Sep 17 00:00:00 2001 From: chenxiaojun <956334972@qq.com> Date: Wed, 11 Dec 2019 16:17:34 +0800 Subject: [PATCH 09/10] =?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>=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 --- Data/update.sql | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/Data/update.sql b/Data/update.sql index ec8fee41a..49226d3df 100644 --- a/Data/update.sql +++ b/Data/update.sql @@ -697,4 +697,17 @@ ALTER TABLE `tab_pay_info` ADD COLUMN `game_player_id` varchar(30) DEFAULT '0' C ALTER TABLE `tab_pay_info` ADD COLUMN `sdk_version` tinyint(2) DEFAULT '1' COMMENT '区别sdk版本1安卓 2苹果 '; ALTER TABLE `tab_pay_info` ADD COLUMN `promote_account` varchar(30) DEFAULT '' COMMENT '推广员账号'; -- 菜单(游戏充值预下单) -INSERT INTO `sys_menu`(`title`, `pid`, `sort`, `url`, `hide`, `tip`, `group`, `is_dev`, `status`) VALUES ('游戏充值预下单', 16, 0, 'BehaviorLog/game', 0, '', '行为日志', 0, 1); \ No newline at end of file +INSERT INTO `sys_menu`(`title`, `pid`, `sort`, `url`, `hide`, `tip`, `group`, `is_dev`, `status`) VALUES ('游戏充值预下单', 16, 0, 'BehaviorLog/game', 0, '', '行为日志', 0, 1); + +--2019-12-11 cxj +--玩家角色每日登录记录表 +CREATE TABLE `tab_user_play_login_record_by_day` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `user_id` int(11) NOT NULL DEFAULT 0 COMMENT '玩家id', + `game_id` int(11) NOT NULL DEFAULT 0 COMMENT '游戏id', + `server_id` varchar(30) NOT NULL DEFAULT '' COMMENT '区服id', + `role_id` varchar(30) NOT NULL DEFAULT '' COMMENT '角色id', + `create_time` int(10) NOT NULL DEFAULT 0 COMMENT '创建时间', + PRIMARY KEY (`id`), + INDEX `search`(`user_id`, `game_id`, `create_time`) USING BTREE +); \ No newline at end of file From 9d09913bd02770c39363a8f2a5d73da2ce23fe9b Mon Sep 17 00:00:00 2001 From: chenxiaojun <956334972@qq.com> Date: Wed, 11 Dec 2019 16:32:02 +0800 Subject: [PATCH 10/10] =?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>=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 --- .../Admin/Controller/AutoController.class.php | 61 ------------------- .../Home/Controller/QueryController.class.php | 2 +- Data/update.sql | 13 ---- 3 files changed, 1 insertion(+), 75 deletions(-) diff --git a/Application/Admin/Controller/AutoController.class.php b/Application/Admin/Controller/AutoController.class.php index 31037e19a..c704aec94 100644 --- a/Application/Admin/Controller/AutoController.class.php +++ b/Application/Admin/Controller/AutoController.class.php @@ -1034,65 +1034,4 @@ public function auto_rrdae(){ ]; return $ret; } - - //玩家角色每日登录记录 - public function userPlayLoginRecordByDayCount($time = '') - { - if ($time == '') { - $time = strtotime(date('Y-m-d 00:00:00', time() - (3600 * 24))); - } else { - $time = strtotime(date('Y-m-d 00:00:00', strtotime($time))); - } - $res = M('user_play_login_record_by_day', 'tab_')->where(array('create_time' => $time))->find(); - if (empty($res)) { - $map['login_time'] = ['between', [$time, strtotime(date('Y-m-d 23:59:59', $time))]]; - - $this->userPlayLoginRecordByDayByMap($map); - } - } - - //玩家角色每日登录记录--初始化 - public function userPlayLoginRecordByDayInitial() - { - $res = M('user_play_login_record_by_day', 'tab_')->order('id asc')->find(); - if (empty($res)) { - ini_set('memory_limit','800M'); - $time = strtotime(date('Y-m-d 00:00:00', time())); - $map['login_time'] = ['lt', $time]; - - $this->userPlayLoginRecordByDayByMap($map); - echo '初始化成功'; - } else { - echo '表存在记录,无法初始化'; - } - } - - //玩家角色每日登录记录 - private function userPlayLoginRecordByDayByMap($map = []) - { - if (isset($map['login_time'])) { - $map['game_id'] = ['gt', 0]; - $field = 'FROM_UNIXTIME(login_time, "%Y-%m-%d") as day,user_id,game_id'; - $loginData = M('user_game_login_record', 'tab_')->field($field) - ->where($map) - ->group('day,game_id,user_id') - ->select(); - - if (!empty($loginData)) { - $data = []; - foreach ($loginData as &$list) { - $data[] = [ - 'user_id' => $list['user_id'], - 'game_id' => $list['game_id'], - 'server_id' => '', - 'role_id' => '', - 'create_time' => strtotime($list['day']), - ]; - unset($list); - } - unset($loginData); - M('user_play_login_record_by_day', 'tab_')->addAll($data); - } - } - } } diff --git a/Application/Home/Controller/QueryController.class.php b/Application/Home/Controller/QueryController.class.php index b667996d0..2d52f6888 100644 --- a/Application/Home/Controller/QueryController.class.php +++ b/Application/Home/Controller/QueryController.class.php @@ -1859,7 +1859,7 @@ class QueryController extends BaseController $loginRecordMap['lr.create_time'] = $map['uc.create_time']; $loginRecordMap['_string'] = 'lr.user_id = uc.user_id and lr.game_id = uc.game_id'; - $fieldLR = M('user_play_login_record_by_day', 'tab_')->alias('lr') + $fieldLR = M('login_daily_record', 'tab_')->alias('lr') ->field("count(*) as count") ->where($loginRecordMap) ->buildSql(); diff --git a/Data/update.sql b/Data/update.sql index 49226d3df..95adabd49 100644 --- a/Data/update.sql +++ b/Data/update.sql @@ -698,16 +698,3 @@ ALTER TABLE `tab_pay_info` ADD COLUMN `sdk_version` tinyint(2) DEFAULT '1' COMME ALTER TABLE `tab_pay_info` ADD COLUMN `promote_account` varchar(30) DEFAULT '' COMMENT '推广员账号'; -- 菜单(游戏充值预下单) INSERT INTO `sys_menu`(`title`, `pid`, `sort`, `url`, `hide`, `tip`, `group`, `is_dev`, `status`) VALUES ('游戏充值预下单', 16, 0, 'BehaviorLog/game', 0, '', '行为日志', 0, 1); - ---2019-12-11 cxj ---玩家角色每日登录记录表 -CREATE TABLE `tab_user_play_login_record_by_day` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `user_id` int(11) NOT NULL DEFAULT 0 COMMENT '玩家id', - `game_id` int(11) NOT NULL DEFAULT 0 COMMENT '游戏id', - `server_id` varchar(30) NOT NULL DEFAULT '' COMMENT '区服id', - `role_id` varchar(30) NOT NULL DEFAULT '' COMMENT '角色id', - `create_time` int(10) NOT NULL DEFAULT 0 COMMENT '创建时间', - PRIMARY KEY (`id`), - INDEX `search`(`user_id`, `game_id`, `create_time`) USING BTREE -); \ No newline at end of file