From 93b3affa75ebfd3298fc3e40d0d3cdae0a09ca1d Mon Sep 17 00:00:00 2001 From: chenxiaojun <956334972@qq.com> Date: Wed, 9 Oct 2019 16:19:57 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=B7=E6=9C=8D=E6=A8=A1=E5=9D=97=20?= =?UTF-8?q?=E5=88=86=E6=88=90=E6=AF=94=E4=BE=8B=E6=A8=A1=E5=9D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Home/Controller/ApplyController.class.php | 40 ++- .../Controller/GameDivideController.class.php | 106 ++++++ .../Home/View/default/Apply/index.html | 24 +- .../Home/View/default/Apply/my_game.html | 14 +- .../Home/View/default/GameDivide/index.html | 315 ++++++++++++++++++ .../View/default/Public/promote_base.html | 6 +- Application/User/Api/PromoteApi.class.php | 2 +- Data/update.sql | 7 +- 8 files changed, 482 insertions(+), 32 deletions(-) create mode 100644 Application/Home/Controller/GameDivideController.class.php create mode 100644 Application/Home/View/default/GameDivide/index.html diff --git a/Application/Home/Controller/ApplyController.class.php b/Application/Home/Controller/ApplyController.class.php index 156950d71..f4ce0b712 100644 --- a/Application/Home/Controller/ApplyController.class.php +++ b/Application/Home/Controller/ApplyController.class.php @@ -49,8 +49,18 @@ class ApplyController extends BaseController $this->display($model['tem_list']); } + public function gameSpecialList() + { + $this->index(1); + } + + public function gameList() + { + $this->index(2); + } + //首页 $type-查询的游戏平台类型 0-全部 10-安卓+ios 2-ios 1-安卓 - public function index($p = 0, $type = 0) + public function index($serverType = 1) { $promoteId = empty(I('promote_id')) ? PID : I('promote_id');//搜索的渠道ID $promoteRole = empty(I('promote_role')) ? 1 : I('promote_role');//渠道角色 @@ -65,6 +75,7 @@ class ApplyController extends BaseController $map['tab_game.online_status'] = 1;//开发者游戏上线状态 $map['tab_game.down_port'] = 1;//游戏端口 第三方接口不能申请 $map['tab_game.game_status'] = 1;//游戏状态 + $map['tab_game.server_type'] = $serverType;//专服游戏 if (!empty(I('game_id'))) { $thisRelationGameName = M('Game', 'tab_')->where(array('id' => I('game_id')))->getField('relation_game_name'); @@ -72,6 +83,7 @@ class ApplyController extends BaseController $map['tab_game.relation_game_name'] = ['like', $thisRelationGameName]; } + $type = I('get.type', 0); $group = ''; switch ($type) { case 1: @@ -114,7 +126,7 @@ class ApplyController extends BaseController break; } - $page = intval($p); + $page = intval(I('get.p', 0)); $page = $page ? $page : 1; //默认显示第一页数据 if (isset($_REQUEST['row'])) { @@ -180,10 +192,12 @@ class ApplyController extends BaseController $this->assign('promoteData', getAllPromoteListByType($promoteRole)); // $this->assign('addPermission', $addPermission); $this->assign('type', $type); + $this->assign('myGame', ($serverType == 1) ? 'specialMyGameList' : 'myGameList'); + $this->assign('game', ($serverType == 1) ? 'gameSpecialList' : 'gameList'); $this->meta_title = "申请游戏"; - $this->display(); + $this->display('index'); } //查看游戏详情 @@ -471,8 +485,17 @@ class ApplyController extends BaseController } + public function specialMyGameList() + { + $this->my_game(1); + } + + public function myGameList() + { + $this->my_game(2); + } - public function my_game($type = -1, $p = 0) + public function my_game($serverType = 1) { //渠道可申请游戏 if (empty($_REQUEST['promote_id'])) { @@ -493,6 +516,7 @@ class ApplyController extends BaseController } $map['tab_apply.promote_id'] = $promoteId; + $map['tab_game.server_type'] = $serverType;//游戏服务器类型 if ($_REQUEST['game_id'] != null) { $relationGameName = M('Game', 'tab_')->where(array('id' => $_REQUEST['game_id']))->getField('relation_game_name'); @@ -508,7 +532,7 @@ class ApplyController extends BaseController // $map['tab_apply.status'] = 1; // $map['tab_game.game_status'] = 1;//游戏状态 // empty(I('sdk_version')) || $map['tab_game.sdk_version'] = I('sdk_version'); - $page = intval($p); + $page = intval(I('get.p', 0)); $page = $page ? $page : 1; //默认显示第一页数据 if (isset($_REQUEST['row'])) { @@ -561,7 +585,6 @@ class ApplyController extends BaseController $this->assign("url", $url); $this->assign("count", $count); $this->assign("row", $row); - $this->assign('model', $model); $this->assign('promoteId', $promoteId); $this->assign('thisParentPromoteId', getParentPromoteId(PID)); $this->assign('parentPromoteId', getParentPromoteId($promoteId)); @@ -569,8 +592,11 @@ class ApplyController extends BaseController $this->assign('promoteRole', $promoteRole); $this->assign('promoteData', getAllPromoteListByType($promoteRole)); $this->assign('list_data', $data); + $this->assign('serverType', $serverType); + $this->assign('myGame', ($serverType == 1) ? 'specialMyGameList' : 'myGameList'); + $this->assign('game', ($serverType == 1) ? 'gameSpecialList' : 'gameList'); $this->meta_title = "我的游戏"; - $this->display(); + $this->display('my_game'); } diff --git a/Application/Home/Controller/GameDivideController.class.php b/Application/Home/Controller/GameDivideController.class.php new file mode 100644 index 000000000..d0ef8b617 --- /dev/null +++ b/Application/Home/Controller/GameDivideController.class.php @@ -0,0 +1,106 @@ + 0) { + $this->error('权限异常'); + } + + $securityCode = empty(session('game_divide_second_pwd')) ? '' : session('game_divide_second_pwd'); + $model = new PromoteApi(); + $res = $model->verify_er_User(PID, $securityCode); + if (!empty($securityCode) && $res) { + $map['tab_game.online_status'] = 1;//开发者游戏上线状态 + $map['tab_game.down_port'] = 1;//游戏端口 第三方接口不能申请 + $map['tab_game.game_status'] = 1;//游戏状态 + empty(I('relation_game_id')) || $map['relation_game_id'] = I('relation_game_id'); + empty(I('sdk_version')) || $map['sdk_version'] = I('sdk_version'); + empty(I('server_type')) || $map['server_type'] = I('server_type'); + + $minRatio = floatval(I('min_ratio', 0)); + $maxRatio = floatval(I('max_ratio', 0)); + if (!empty($minRatio) && empty($maxRatio)) { + $map['ratio'] = ['egt', $minRatio]; + } elseif (empty($minRatio) && !empty($maxRatio)) { + $map['ratio'] = ['elt', $maxRatio]; + } elseif (!empty($minRatio) && !empty($maxRatio)) { + $map['ratio'] = ['between', [$minRatio, $maxRatio]]; + } + + $page = intval(I('get.p', 0)); + $page = $page ? $page : 1; //默认显示第一页数据 + + if (isset($_REQUEST['row'])) { + $row = $_REQUEST['row']; + } else { + $row = 10; + } + + $data = M('Game', 'tab_') + ->field('id,icon,game_name,game_type_name,sdk_version,server_type,discount,ratio') + ->where($map) + ->order('sort desc') + ->page($page, $row) + ->select(); + $count = M('Game', 'tab_') + ->where($map) + ->count(); + + //分页 + $parameter['p'] = I('get.p', 1); + $parameter['row'] = I('get.row'); + empty(I('relation_game_id')) || $parameter['relation_game_id'] = I('relation_game_id'); + empty(I('sdk_version')) || $parameter['sdk_version'] = I('sdk_version'); + empty(I('server_type')) || $parameter['server_type'] = I('server_type'); + empty($minRatio) || $parameter['min_ratio'] = $minRatio; + empty($maxRatio) || $parameter['max_ratio'] = $maxRatio; + + $page = set_pagination($count, $row, $parameter); + if ($page) { + $this->assign('_page', $page); + } + + $this->assign('dataList', $data); + $this->assign('count', $count); + $this->assign('serverType', I('server_type', 0)); + } + + $this->meta_title = "分成比例"; + $this->display(); + } + + public function verifyPassword() + { + $password = I('post.password'); + $model = new PromoteApi(); + $res = $model->verify_er_User(PID, $password); + + if ($res) { + session('game_divide_second_pwd', $password); + + $data['status'] = 1; + $data['msg'] = '验证成功'; + + $this->ajaxReturn($data); + } else { + $data['status'] = 0; + $data['msg'] = '安全密码不正确'; + + $this->ajaxReturn($data); + } + } +} \ No newline at end of file diff --git a/Application/Home/View/default/Apply/index.html b/Application/Home/View/default/Apply/index.html index b97fa4100..c540ffa72 100644 --- a/Application/Home/View/default/Apply/index.html +++ b/Application/Home/View/default/Apply/index.html @@ -118,37 +118,31 @@ 全部游戏 - 全部游戏 + 全部游戏 Android+ios游戏 - Android+ios游戏 + Android+ios游戏 IOS游戏 - IOS游戏 + IOS游戏 Android游戏 - Android游戏 + Android游戏 - 我的游戏 + 我的游戏
- - - - - -
@@ -186,7 +180,7 @@
-
@@ -434,7 +428,7 @@ thisElement.addClass('highlight'); if (promoteRole == 1) { - location.href = "{:U('index', array('type' => $type))}"; + location.href = "{:U($game, array('type' => $type))}"; } else { getPromoteListByRole(promoteRole); } @@ -640,7 +634,7 @@ success: function (res) { if (res.status) { $(obj).attr("onclick", "").html("申请成功").addClass("proc wait"); - location.href = "{:U('index')}"; + location.href = "{:U($game)}"; } else { layer.msg(res.msg, {icon: 2}); } @@ -800,7 +794,7 @@ } //导航高亮 - highlight_subnav('{:U("Apply / index")}'); + highlight_subnav('{:U("Apply/".$game)}'); //查看游戏详情 function viewGameDetailed(id) { diff --git a/Application/Home/View/default/Apply/my_game.html b/Application/Home/View/default/Apply/my_game.html index 6b476d5b6..deddc2f27 100644 --- a/Application/Home/View/default/Apply/my_game.html +++ b/Application/Home/View/default/Apply/my_game.html @@ -99,10 +99,10 @@