diff --git a/Application/Admin/Controller/GameController.class.php b/Application/Admin/Controller/GameController.class.php
index cf7174101..b45cdcb4e 100644
--- a/Application/Admin/Controller/GameController.class.php
+++ b/Application/Admin/Controller/GameController.class.php
@@ -180,6 +180,14 @@ class GameController extends ThinkController
} else {
$_POST['display_site'] = '';
}
+
+ $content = $_POST['content'];
+ if(!empty($content)) {
+ $_POST['detail_content'] = $content;
+ } else {
+ $_POST['detail_content'] = '';
+ }
+
$pinyin = new \Think\Pinyin();
$num = mb_strlen($_POST['game_name'], 'UTF8');
@@ -288,9 +296,10 @@ class GameController extends ThinkController
} else {
$_POST['display_site'] = '';
}
-
+ $content = $_POST['content'];
$game = D(self::model_name);//M('$this->$model_name','tab_');
$_POST['discount'] == '' ? $_POST['discount'] = 10 : $_POST['discount'];
+ $_POST['detail_content'] = $content;
$res = $game->update();
$id = $res["id"];
$sibling = D("Game")->find($id);
diff --git a/Application/Admin/View/Game/add.html b/Application/Admin/View/Game/add.html
index 7e8ad8c7a..a967b6986 100644
--- a/Application/Admin/View/Game/add.html
+++ b/Application/Admin/View/Game/add.html
@@ -191,7 +191,19 @@
游戏ICON |
diff --git a/Application/Home/Controller/ApplyController.class.php b/Application/Home/Controller/ApplyController.class.php
index ac8cacea8..a7e554662 100644
--- a/Application/Home/Controller/ApplyController.class.php
+++ b/Application/Home/Controller/ApplyController.class.php
@@ -198,6 +198,105 @@ class ApplyController extends BaseController
$this->meta_title = "申请游戏";
$this->display('index');
}
+
+ //查看游戏资料专区
+ public function feature($p = 0, $type = 0)
+ {
+ $promoteId = empty(I('promote_id')) ? PID : I('promote_id');//搜索的渠道ID
+ $promoteRole = empty(I('promote_role')) ? 1 : I('promote_role');//渠道角色
+ //$parentPromoteId = getParentPromoteId($promoteId);//上级渠道ID
+ $thisParentPromoteId = getParentPromoteId(PID);//本账号上级渠道ID
+
+// $addPermission = 1;//是否有添加游戏权限
+// if ($thisParentPromoteId == 0 && $promoteRole == 3) {
+// $addPermission = 0;
+// }
+
+ $map['tab_game.online_status'] = 1;//开发者游戏上线状态
+ $map['tab_game.down_port'] = 1;//游戏端口 第三方接口不能申请
+ $map['tab_game.game_status'] = 1;//游戏状态
+ $map['tab_game.developers'] = 0; //平台游戏(官网游戏,非开发者游戏)
+
+ $applyPromote = M('apply','tab_')->field('game_id')->where(['promote_id' => $promoteId])->select();
+ $noDeveloperGameArr = array();
+
+ foreach ($applyPromote as $key => $value) {
+ $applyPromoteGameId = $value['game_id'];
+ $gameInfo = M('Game','tab_')
+ ->field('id,icon,game_name,features,sdk_version,game_size,game_type_name,relation_game_name,developers')
+ ->where(['id' => $applyPromoteGameId])->select();
+ if($gameInfo[0]['developers'] > 0){
+ unset($gameInfo[0]['developers']);
+ $noDeveloperGameArr[] = $gameInfo[0]['id'] ; //非开发者游戏
+ }
+ }
+
+
+ $page = intval($p);
+ $page = $page ? $page : 1; //默认显示第一页数据
+
+ if (isset($_REQUEST['row'])) {
+ $row = $_REQUEST['row'];
+ } else {
+ $row = 10;
+ }
+ $map['_logic'] = 'and';
+ if (!empty(I('game_id'))) {
+ $thisRelationGameName = M('Game', 'tab_')->where(array('id' => I('game_id')))->getField('relation_game_name');
+
+ $map['tab_game.relation_game_name'] = ['like', $thisRelationGameName];
+ $where['_complex'] = $map;
+ // $where['tab_game.id'] = ['in',$noDeveloperGameArr];
+ // $where['_logic']='or';
+ }else {
+ $where['_complex'] = $map;
+ $where['tab_game.id'] = ['in',$noDeveloperGameArr];
+ $where['_logic']='or';
+ }
+
+ $data = M('Game', 'tab_')
+ ->field('tab_game.id,tab_game.icon,tab_game.game_name,tab_game.features,tab_game.sdk_version,tab_game.game_size,tab_game.game_type_name,tab_game.relation_game_name,ta_1.id as apply_id_1')
+ ->join('left join tab_apply as ta_1 on tab_game.id = ta_1.game_id and ta_1.offline_status = 0 and ta_1.promote_id = ' . $promoteId)//查询是否拥有该游戏
+ ->where($where)
+ ->order('tab_game.developers desc,tab_game.sort desc,tab_game.id desc')
+ ->page($page, $row)
+ ->select();
+ //$AllData = array_merge($noDeveloperGameArr,$data);
+
+ /* 查询记录总数 */
+ $count = M("Game", "tab_")
+ ->field('tab_game.id')
+ ->where($map)
+ ->select();
+ $count = count($count);
+
+ //分页
+ $parameter['p'] = I('get.p', 1);
+ $parameter['row'] = I('get.row');
+ $parameter['type'] = $type;
+ $parameter['promote_role'] = $promoteRole;
+ empty(I('promote_id')) || $parameter['promote_id'] = I('promote_id');
+
+ $page = set_pagination($count, $row, $parameter);
+ if ($page) {
+ $this->assign('_page', $page);
+ }
+
+ $this->assign('list_data', $data);
+ $this->assign("count", $count);
+ $this->assign("promoteId", $promoteId);
+ // $this->assign('parentPromoteId', $parentPromoteId);
+ $this->assign('thisParentPromoteId', $thisParentPromoteId);
+ // $this->assign('promoteRole', $promoteRole);
+ $this->assign('pID', PID);
+ //$this->assign('promoteData', getAllPromoteListByType($promoteRole));
+// $this->assign('addPermission', $addPermission);
+ // $this->assign('type', $type);
+
+ $this->meta_title = "申请游戏";
+
+ $this->display();
+ }
//查看游戏详情
public function viewGameDetailed()
@@ -1597,4 +1696,25 @@ class ApplyController extends BaseController
$this->ajaxReturn(['status' => 1, 'data' => $enableStatus]);
}
+
+ public function backDetailData() { //返回详情数据
+ $result = ['code' => 10001,'msg' => "该游戏信息不存在,请确认!",'error' => 1,'info' => ''];
+ $id = $_POST['id'];
+ if(empty($id)) {
+ $this->ajaxReturn($result);
+ }
+ $gameInfo = M('Game','tab_')->where(['id' => $id])->getField('detail_content');
+ if(!$gameInfo) {
+ $this->ajaxReturn($result);
+ }else {
+ $result['code'] = 10000;
+ $result['msg'] = "获取信息成功";
+ $result['error'] = -1;
+ $result['info'] = $gameInfo;
+ $this->ajaxReturn($result);
+
+ }
+
+
+ }
}
diff --git a/Application/Home/View/default/Apply/feature.html b/Application/Home/View/default/Apply/feature.html
new file mode 100644
index 000000000..0211843b3
--- /dev/null
+++ b/Application/Home/View/default/Apply/feature.html
@@ -0,0 +1,748 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 资料专区
+
+
+
+
+
+
+
+
+ -
+
+
暂无数据
+
+
+
+
+ -
+
+
+
+
+
+
+
+ {$_page}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Data/update.sql b/Data/update.sql
index d9b021b88..6183e6438 100644
--- a/Data/update.sql
+++ b/Data/update.sql
@@ -66,4 +66,5 @@ alter table tab_game_source add column `org_plist_url` varchar(255) NOT NULL def
-- ----------------------------
-- 2019-10-08 cxj
-- ----------------------------
-ALTER TABLE `tab_game` ADD COLUMN `server_type` tinyint(2) NOT NULL DEFAULT 1 COMMENT '1-专服 2-混服' AFTER `support_ratio`;
\ No newline at end of file
+ALTER TABLE `tab_game` ADD COLUMN `server_type` tinyint(2) NOT NULL DEFAULT 1 COMMENT '1-专服 2-混服' AFTER `support_ratio`;
+ALTER TABLE `tab_game` ADD COLUMN `detail_content` MEDIUMTEXT NULL DEFAULT NULL COMMENT '游戏资料介绍' AFTER `features`;
\ No newline at end of file
|