推广配置

master
sunke 5 years ago
parent 9152a3ef59
commit d2b7e91a64

@ -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);
}
}

@ -968,7 +968,7 @@
<tr style="display:none" id="moban">
<td class="l">EXCEL模板</td>
<td class="r" >
<a href="javascript:void();">下载模板</a>
<a href="{:U('downloadDemo',['game_id'=>$game_id])}">下载模板</a>
</td>
</tr>
@ -985,12 +985,13 @@
</tbody>
</table>
<div class="data_list data_game_list" id="data_list"></div>
<link rel="stylesheet" type="text/css" href="__STATIC__/layui-v2.5.5/css/layui.css">
<input type="hidden" name="group_id" id="group_id" value="{$_GET['group_id']}">
<input type="hidden" name="promote_data" id="promote_data" value="[]">
<div id="transfer_promote" class="demo-transfer" style="margin-left: 100px;margin-top: 35px;display:none"></div>
</div>
<div class="data_list data_game_list" id="data_list"></div>
<link rel="stylesheet" type="text/css" href="__STATIC__/layui-v2.5.5/css/layui.css">
<input type="hidden" name="group_id" id="group_id" value="{$_GET['group_id']}">
<input type="hidden" name="promote_data" id="promote_data" value="[]">
<div id="transfer_promote" class="demo-transfer" style="margin-left: 100px;margin-top: 35px;display:none"></div>
<div class="form-item cf">
<input type="hidden" name='id' value="{$data['id']}" />
<input type="hidden" name='type' value="{$_GET['type']}" />

@ -1086,3 +1086,14 @@ CREATE TABLE `tab_sociaty_games` (
`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',
`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 '工会授权游戏';
Loading…
Cancel
Save