From d2b7e91a64cd0cbcc811732b2ab381ae6379d784 Mon Sep 17 00:00:00 2001 From: sunke <18850253506@163.com> Date: Wed, 15 Jan 2020 16:46:02 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8E=A8=E5=B9=BF=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Admin/Controller/GameController.class.php | 21 +++++++++++++++++-- Application/Admin/View/Game/edit.html | 13 ++++++------ Data/update.sql | 11 ++++++++++ 3 files changed, 37 insertions(+), 8 deletions(-) diff --git a/Application/Admin/Controller/GameController.class.php b/Application/Admin/Controller/GameController.class.php index 19a97ebcf..eb6b0b898 100644 --- a/Application/Admin/Controller/GameController.class.php +++ b/Application/Admin/Controller/GameController.class.php @@ -935,13 +935,13 @@ class GameController extends ThinkController $dataList = []; for($i=2;$i<=$highestRow;$i++) { - $promote_id = $objPHPExcel->getActiveSheet()->getCell("B".$i)->getValue(); + $promote_id = $objPHPExcel->getActiveSheet()->getCell("A".$i)->getValue(); $promoteInfo = M('promote','tab_')->field('account')->where(['id' => $promote_id ])->find(); if(empty($promoteInfo)) { break; } - $game_id = $objPHPExcel->getActiveSheet()->getCell("C".$i)->getValue(); + $game_id = $objPHPExcel->getActiveSheet()->getCell("B".$i)->getValue(); $gameInfo = M('game','tab_')->field('game_name,game_status')->where(['id'=>$game_id])->select(); if(empty($gameInfo)) { break; @@ -965,4 +965,21 @@ class GameController extends ThinkController $this->ajaxReturn(json_encode($returnData)); } + //下载模板 + public function downloadDemo() { + $game_id = $_REQUEST['game_id']; + $game_name = M('game','tab_')->where(['id'=>$game_id])->getField('game_name'); + $data[] = [ + 'promoteid' => 99, + 'game_id' => $game_id, + 'game_name' => $game_name + ]; + $field = array( + "promoteid"=>"会长ID", + "game_id"=>"游戏ID(无需修改,已默认当前游戏)", + "game_name"=>"游戏名称(无需修改,已默认当前游戏)" + ); + data2csv($data,"模板",$field); + } + } diff --git a/Application/Admin/View/Game/edit.html b/Application/Admin/View/Game/edit.html index 56c0b7f48..f0c2dc058 100644 --- a/Application/Admin/View/Game/edit.html +++ b/Application/Admin/View/Game/edit.html @@ -968,7 +968,7 @@ EXCEL模板 - 下载模板 + 下载模板 @@ -985,12 +985,13 @@ +
+ + + + -
- - - - +
diff --git a/Data/update.sql b/Data/update.sql index cc96f7fdf..da4cfb6d1 100644 --- a/Data/update.sql +++ b/Data/update.sql @@ -1077,6 +1077,17 @@ CREATE TABLE `sys_document_pop_rules` ( --会长设置推广配置-- +CREATE TABLE `tab_sociaty_games` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `promote_id` int(11) NOT NULL COMMENT '会长ID', + `game_id` int(11) NOT NULL COMMENT '游戏ID', + `status` tinyint(1) NOT null DEFAULT '0' COMMENT '状态 0 禁用 1 启用', + `create_time` int(10) NOT NULL DEFAULT '0' COMMENT '创建时间', + `update_time` int(10) NOT NULL DEFAULT '0' COMMENT '更新时间', + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin COMMENT '工会授权游戏'; + +--会长推广配置-- CREATE TABLE `tab_sociaty_games` ( `id` int(11) NOT NULL AUTO_INCREMENT, `promote_id` int(11) NOT NULL COMMENT '会长ID',