游戏管理->设置

master
chenxiaojun 5 years ago
parent 5ba238766d
commit b9a29a5032

@ -965,6 +965,14 @@ function getParentPromoteId($promoteId)
return D('Promote')->where($map)->getField('parent_id');
}
//获会长渠道ID
function getGrandPromoteId($promoteId)
{
$map['id'] = $promoteId;
return D('Promote')->where($map)->getField('grand_id');
}
function getGamePermission($gameId)
{
$gameData = M('Game', 'tab_')
@ -1171,3 +1179,9 @@ function promoteCan($promoteId, \Closure $callback)
$level = get_promote_level(session('promote_auth.pid'));
return $callback($level);
}
//获取下级游戏添加权限
function getChildGameAddPermission($promoteId)
{
return D('Promote')->where(array('id' => $promoteId))->getField('child_game_permission');
}

@ -65,13 +65,11 @@ class ApplyController extends BaseController
$promoteId = empty(I('promote_id')) ? PID : I('promote_id');//搜索的渠道ID
$promoteRole = empty(I('promote_role')) ? 1 : I('promote_role');//渠道角色
$parentPromoteId = getParentPromoteId($promoteId);//上级渠道ID
$grandPromoteId = getGrandPromoteId($promoteId);
$grandPromoteId = empty($grandPromoteId) ? $parentPromoteId : $grandPromoteId;//本账号会长渠道ID
$childGameAddPermission = getChildGameAddPermission($grandPromoteId);//游戏添加权限
$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;//游戏状态
@ -103,7 +101,7 @@ class ApplyController extends BaseController
case 10:
$group = 'tab_game.relation_game_id';
if ($parentPromoteId > 0) {
if ($parentPromoteId > 0 && $childGameAddPermission == 0) {
$gameRelationGameIdList = M('Game', 'tab_')->group('relation_game_id')->having('count(id) = 2')->getField('relation_game_id', true);
if (count($gameRelationGameIdList) > 0) {
$gameRelationGameIdList = implode(',', $gameRelationGameIdList);
@ -136,14 +134,14 @@ class ApplyController extends BaseController
}
$join = '';
if ($parentPromoteId > 0) {
$map['tab_apply.promote_id'] = PID;
if ($parentPromoteId > 0 && $childGameAddPermission == 0) {
$map['tab_apply.promote_id'] = $grandPromoteId;
if (!empty($where)) {
$map['_logic'] = 'and';
$map['_complex'] = $where;
}
$join = 'inner join tab_apply on tab_game.id = tab_apply.game_id and tab_apply.offline_status = 0';//查询上级游戏
$join = 'tab_apply on tab_game.id = tab_apply.game_id and tab_apply.offline_status = 0';//查询上级游戏
}
$data = M('Game', 'tab_')
@ -155,6 +153,7 @@ class ApplyController extends BaseController
->where($map)
->group($group)
->order('tab_game.sort desc,tab_game.id desc')
// ->fetchSql(true)
->page($page, $row)
->select();
@ -190,7 +189,6 @@ class ApplyController extends BaseController
$this->assign('promoteRole', $promoteRole);
$this->assign('pID', PID);
$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');
@ -515,6 +513,9 @@ class ApplyController extends BaseController
}
$map['tab_apply.promote_id'] = $promoteId;
$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 ($_REQUEST['game_id'] != null) {
@ -909,13 +910,16 @@ class ApplyController extends BaseController
}
$promoteData = D('Promote')->where(array('id' => $promoteId))->find();
$grandPromoteId = getGrandPromoteId($promoteId);
$grandPromoteId = empty($grandPromoteId) ? $promoteData['parent_id'] : $grandPromoteId;//本账号会长渠道ID
$childGameAddPermission = getChildGameAddPermission($grandPromoteId);//游戏添加权限
if ($_POST['sdk_type'] > 0) {
if ($promoteData['parent_id'] > 0) {
if ($promoteData['parent_id'] > 0 && $childGameAddPermission == 0) {
$gameRelationName = M('game', 'tab_')->where(array('id' => $_POST['game_id']))->getField('relation_game_name');
$gameData = M('game', 'tab_')
->field('tab_game.*')
->join('tab_apply on tab_game.id = tab_apply.game_id and tab_apply.offline_status = 0 and tab_apply.promote_id = ' . PID)
->join('tab_apply on tab_game.id = tab_apply.game_id and tab_apply.offline_status = 0 and tab_apply.promote_id = ' . $grandPromoteId)
->where(array('tab_game.relation_game_name' => $gameRelationName))
->select();
} else {
@ -925,10 +929,10 @@ class ApplyController extends BaseController
->select();
}
} else {
if ($promoteData['parent_id'] > 0) {
if ($promoteData['parent_id'] > 0 && $childGameAddPermission == 0) {
$gameData = M('game', 'tab_')
->field('tab_game.*')
->join('tab_apply on tab_game.id = tab_apply.game_id and tab_apply.offline_status = 0 and tab_apply.promote_id = ' . PID)
->join('tab_apply on tab_game.id = tab_apply.game_id and tab_apply.offline_status = 0 and tab_apply.promote_id = ' . $grandPromoteId)
->where($gameMap)->select();
} else {
$gameData = M('game', 'tab_')->where($gameMap)->select();

@ -133,33 +133,40 @@ class PromoteController extends BaseController
$where['spend.pay_status'] = 1;
$where['spend.is_check'] = array('NEQ', 2);
switch ($type) {
case 1: { // 今天
case 1:
{ // 今天
$start = mktime(0, 0, 0, date('m'), date('d'), date('Y'));
$end = mktime(0, 0, 0, date('m'), date('d') + 1, date('Y')) - 1;
};
break;
case 3: {
case 3:
{
// 本月
$start = mktime(0, 0, 0, date('m'), 1, date('Y'));
$end = mktime(0, 0, 0, date('m') + 1, 1, date('Y')) - 1;
};
break;
case 4: {
case 4:
{
// 本年
$start = mktime(0, 0, 0, 1, 1, date('Y'));
$end = mktime(0, 0, 0, 1, 1, date('Y') + 1) - 1;
};
break;
case 5: { // 昨天
case 5:
{ // 昨天
$start = mktime(0, 0, 0, date('m'), date('d') - 1, date('Y'));
$end = mktime(0, 0, 0, date('m'), date('d'), date('Y'));
};
break;
case 6:{
case 6:
{
$start = mktime(0, 0, 0, date('m') - 1, 1, date('Y'));
$end = mktime(0, 0, 0, date('m'), 1, date('Y')) - 1;
};break;
case 9: { // 前七天
};
break;
case 9:
{ // 前七天
$start = mktime(0, 0, 0, date('m'), date('d') - 6, date('Y'));
$end = mktime(date('H'), date('m'), date('s'), date('m'), date('d'), date('Y'));
};
@ -203,7 +210,8 @@ class PromoteController extends BaseController
}
public function home_read_data(){
public function home_read_data()
{
$type = I("type", "0");
$game_id = I("game_id");
$pg = I("page", "0");
@ -254,7 +262,8 @@ class PromoteController extends BaseController
}
public function quick_menu_list(){
public function quick_menu_list()
{
$data_list = M("quick_menu qmn", "tab_")
->join("left join tab_promote_quick_menu as pqmn on qmn.id=pqmn.quick_menu_id and promote_id=" . get_pid())
->field("qmn.*,pqmn.id as exist_id")
@ -267,7 +276,8 @@ class PromoteController extends BaseController
}
public function quick_menu_set(){
public function quick_menu_set()
{
$menu_id = I("menu_id");
$info = M("promote_quick_menu ", "tab_")
->where(
@ -293,7 +303,8 @@ class PromoteController extends BaseController
// 消息列表
public function msg_list($type=56,$p=0){
public function msg_list($type = 56, $p = 0)
{
if (isset($_REQUEST['row'])) {
$row = $_REQUEST['row'];
} else {
@ -385,7 +396,8 @@ class PromoteController extends BaseController
}
$pattern = "/^([0-9A-Za-z\\-_\\.]+)@([0-9a-z]+\\.[a-z]{2,3}(\\.[a-z]{2})?)$/i";
if (!preg_match($pattern, $_REQUEST['email'])) {
$this->error('邮箱地址错误', U('Promote/base_info'));exit;
$this->error('邮箱地址错误', U('Promote/base_info'));
exit;
}
// if (empty($_REQUEST['alipay_account']) ) {
// $this->error('请输入支付宝账号', U('Promote/base_info'));
@ -993,7 +1005,8 @@ class PromoteController extends BaseController
* @param int $level
* @param int $size
*/
public function qrcode($level=3,$size=4,$url=""){
public function qrcode($level = 3, $size = 4, $url = "")
{
Vendor('phpqrcode.phpqrcode');
$errorCorrectionLevel = intval($level);//容错级别
$matrixPointSize = intval($size);//生成图片大小
@ -1003,7 +1016,8 @@ class PromoteController extends BaseController
echo $object->png(base64_decode(base64_decode($url)), false, $errorCorrectionLevel, $matrixPointSize, 2);
}
public function checkAccount($account){
public function checkAccount($account)
{
$user = get_promote_entity($account, true);
if ($user) {
$this->ajaxReturn(array('status' => 1));
@ -1011,13 +1025,14 @@ class PromoteController extends BaseController
$this->ajaxReturn(array('status' => 0));
}
}
public function balance() {
public function balance()
{
if (IS_POST) {
$real_amount = $amount = I('amount');
if (!is_numeric($amount)) {
$res_msg = '充值金额不是数字';
$this->show_balance();
@ -1126,7 +1141,6 @@ class PromoteController extends BaseController
}
} else {
$model = M('Promote', 'tab_');
$data = $model->find(session("promote_auth.pid"));
@ -1138,7 +1152,8 @@ class PromoteController extends BaseController
}
public function balance_recharge() {
public function balance_recharge()
{
if (IS_POST) {
$real_amount = $amount = I('amount', 0, 'intval');
@ -1224,7 +1239,6 @@ class PromoteController extends BaseController
}
} else {
$this->ajaxReturn(['status' => 0, 'info' => '请求有误']);
}
@ -1237,19 +1251,22 @@ class PromoteController extends BaseController
* @return [type] [description]
* @author cb <[email address]>
*/
public function goldpig_pay(){
public function goldpig_pay()
{
if (IS_POST) {
SafeFilter($_POST);
$msign = think_encrypt(md5($_POST['amount'] . $_POST['pay_order_number']));
if ($msign !== $_POST['sign']) {
$this->error('验证失败',U('promote/balance'));exit;
$this->error('验证失败', U('promote/balance'));
exit;
}
if ($_POST['amount'] <= 0) {
$this->error('金额有误');
}
$url = "./Application/Home/OrderNo/" . $_POST['pay_order_number'] . '.txt';
if (!file_exists($url)) {
$this->error('操作有误',U('promote/balance'));exit;
$this->error('操作有误', U('promote/balance'));
exit;
}
$user = M('Promote', 'tab_')->field('id,account')->where(['account' => $_POST['UserName']])->find();
@ -1264,7 +1281,8 @@ class PromoteController extends BaseController
$url = $baseurl . "UserName={$_POST['UserName']}&Price={$_POST['amount']}&shouji={$_POST['shouji']}&PayID={$_POST['PayID']}&userid={$_POST['userid']}&wooolID={$_POST['wooolID']}&jinzhua={$_POST['pay_order_number']}&jinzhub={$_POST['jinzhub']}&jinzhuc={$_POST['jinzhuc']}&jinzhue={$_POST['pay_order_number']}";
redirect($url);exit;
redirect($url);
exit;
} else {
$this->display();
@ -1274,7 +1292,8 @@ class PromoteController extends BaseController
}
public function show_balance() {
public function show_balance()
{
$model = M('Promote', 'tab_');
$data = $model->find(session("promote_auth.pid"));
$data['bank_area'] = explode(',', $data['bank_area']);
@ -1283,7 +1302,8 @@ class PromoteController extends BaseController
$this->display('balance');
}
public function checkOrder($order_number){
public function checkOrder($order_number)
{
$map['pay_order_number'] = $order_number;
$data = M('Balance', 'tab_')
->where($map)
@ -1297,7 +1317,8 @@ class PromoteController extends BaseController
}
public function add_balance($promote,$data){
public function add_balance($promote, $data)
{
$balance = M("Balance", "tab_");
$balance_data['order_number'] = "";
$balance_data['pay_order_number'] = $data['pay_order_number'];
@ -1316,7 +1337,8 @@ class PromoteController extends BaseController
}
public function wxQrcode($promote='') {
public function wxQrcode($promote = '')
{
if (C('wechat.status') > 0) {
$appid = C('wechat.appid');
$appsecret = C('wechat.appsecret');
@ -1345,7 +1367,8 @@ class PromoteController extends BaseController
}
}
public function wxQrcodeRedirect() {
public function wxQrcodeRedirect()
{
$xml_str = $GLOBALS['HTTP_RAW_POST_DATA'];
@ -1368,7 +1391,8 @@ class PromoteController extends BaseController
}
public function _setOpenid($data,$type) {
public function _setOpenid($data, $type)
{
$event = strtolower($data->Event);
$openid = $data->FromUserName; // 用户
$auth = new WechatAuth(C('wechat.appid'), C('wechat.appsecret'));
@ -1377,13 +1401,16 @@ class PromoteController extends BaseController
$data = array('id' => $promote['id']);
$user = $auth->userInfo($openid);
switch ($event) {
case 'subscribe':{
case 'subscribe':
{
// 关注事件
if (!empty($promote['weixin_openid'])) {
$auth->setText($openid,date('Y-m-d H:i:s').' 请先解绑微信');exit;
$auth->setText($openid, date('Y-m-d H:i:s') . ' 请先解绑微信');
exit;
}
if (str_replace('qrscene_', '', $data['EventKey']) != $promote['weixin_openid_sign']) {
$auth->setText($openid,date('Y-m-d H:i:s').' 页面错误,请刷新页面重试');exit;
$auth->setText($openid, date('Y-m-d H:i:s') . ' 页面错误,请刷新页面重试');
exit;
}
$data['weixin_account'] = emoji_encode($user['nickname']);
$data['weixin_openid'] = $openid;
@ -1393,26 +1420,37 @@ class PromoteController extends BaseController
} else {
$auth->sendText($openid, date('Y-m-d H:i:s') . ' 微信绑定失败');
}
};break;
case 'scan':{
};
break;
case 'scan':
{
// 关注以后
if ($user['subscribe'] != 1) {$auth->setText($openid,date('Y-m-d H:i:s').' 你未关注微信');exit;}
if ($user['subscribe'] != 1) {
$auth->setText($openid, date('Y-m-d H:i:s') . ' 你未关注微信');
exit;
}
if (empty($promote['weixin_openid'])) {
$auth->setText($openid,date('Y-m-d H:i:s').' 请先绑定微信');exit;
$auth->setText($openid, date('Y-m-d H:i:s') . ' 请先绑定微信');
exit;
}
};break;
case 'unsubscribe':{
};
break;
case 'unsubscribe':
{
// 取消关注
if ($promote['weixin_openid'] != $openid) {
$auth->setText($openid,date('Y-m-d H:i:s').' 对不起,你没有权限');exit;
$auth->setText($openid, date('Y-m-d H:i:s') . ' 对不起,你没有权限');
exit;
}
if (str_replace('qrscene_', '', $data['EventKey']) != $promote['weixin_openid_sign']) {
$auth->setText($openid,date('Y-m-d H:i:s').' 页面错误,请刷新页面重试');exit;
$auth->setText($openid, date('Y-m-d H:i:s') . ' 页面错误,请刷新页面重试');
exit;
}
if (empty($promote['weixin_openid'])) {
$auth->setText($openid,date('Y-m-d H:i:s').' 暂未绑定微信');exit;
$auth->setText($openid, date('Y-m-d H:i:s') . ' 暂未绑定微信');
exit;
}
$data['weixin_account'] = '';
$data['weixin_openid'] = '';
@ -1423,12 +1461,14 @@ class PromoteController extends BaseController
$auth->sendText($openid, date('Y-m-d H:i:s') . ' 微信解绑失败');
}
};break;
};
break;
}
}
public function logger($log_content) {
public function logger($log_content)
{
$fg_str = "\n============================================================\n";
$max_size = 500000;
$log_filename = __ROOT__ . "/Uploads/Logs/log" . date('Ymd') . ".xml";
@ -1445,7 +1485,8 @@ class PromoteController extends BaseController
}
public function promoteList($p=1){
public function promoteList($p = 1)
{
switch ($_GET['type']) {
case '':
@ -1460,7 +1501,9 @@ class PromoteController extends BaseController
// 推广员列表
const model_name = 'Promote';
public function promoteLists($p){
public function promoteLists($p)
{
$map = [];
$map['_string'] = 'id=' . session('promote_auth.pid')
. ' or parent_id=' . session('promote_auth.pid')
@ -1552,7 +1595,8 @@ class PromoteController extends BaseController
* @return [type] [description]
* @author [yyh] <[email address]>
*/
public function order_lists($model = null, $p = 0,$extend_map = array()){
public function order_lists($model = null, $p = 0, $extend_map = array())
{
$model || $this->error('模型名标识必须!');
$page = intval($p);
$page = $page ? $page : 1; //默认显示第一页数据
@ -1576,7 +1620,9 @@ class PromoteController extends BaseController
// 链接信息
$value['href'] = $val[2];
// 搜索链接信息中的字段信息
preg_replace_callback('/\[([a-z_]+)\]/', function($match) use(&$fields){$fields[]=$match[1];}, $value['href']);
preg_replace_callback('/\[([a-z_]+)\]/', function ($match) use (&$fields) {
$fields[] = $match[1];
}, $value['href']);
}
if (strpos($val[1], '|')) {
// 显示格式定义
@ -1607,7 +1653,11 @@ class PromoteController extends BaseController
}
if(isset($_REQUEST['row'])) {$row = $_REQUEST['row'];}else{$row = 10;}
if (isset($_REQUEST['row'])) {
$row = $_REQUEST['row'];
} else {
$row = 10;
}
//读取模型数据列表
@ -1662,7 +1712,9 @@ class PromoteController extends BaseController
//分页
$page = set_pagination($count, $row);
if($page) {$this->assign('_page', $page);}
if ($page) {
$this->assign('_page', $page);
}
$data = $this->parseDocumentList($data, $model['id']);
if (isset($extend_map['for_show_pic_list'])) {
@ -1701,7 +1753,8 @@ class PromoteController extends BaseController
* @param array $list 列表数据
* @param integer $model_id 模型id
*/
protected function parseDocumentList($list,$model_id=null){
protected function parseDocumentList($list, $model_id = null)
{
$model_id = $model_id ? $model_id : 1;
$attrList = get_model_attribute($model_id, false, 'id,name,type,extra');
// 对列表数据进行显示处理
@ -1768,8 +1821,7 @@ class PromoteController extends BaseController
@preg_match($regx, $id, $arr_split);
//检查生日日期是否正确
$dtm_birth = "19" . $arr_split[2] . '/' . $arr_split[3] . '/' . $arr_split[4];
if(!strtotime($dtm_birth))
{
if (!strtotime($dtm_birth)) {
return false;
} else {
return true;
@ -1803,7 +1855,8 @@ class PromoteController extends BaseController
}
function ajax_page($count, $row,$ajax_func='index',$current=1) {
function ajax_page($count, $row, $ajax_func = 'index', $current = 1)
{
$aside = '<select id="pagechange" name="row" onchange="seach(this)"><option value="5">每页5条</option><option value="10">每页10条</option><option value="25">每页25条</option><option value="50">每页50条</option><option value="100">每页100条</option></select>';
$count = $count ? $count : 0;
$row = $row ? $row : 10;
@ -1819,6 +1872,42 @@ class PromoteController extends BaseController
return '<div><span class="rows">共 ' . $count . ' 条记录</span></div>';
}
}
public function setChildGamePermission()
{
$parentId = getParentPromoteId(PID);//上级ID
if ($parentId > 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 ($_POST) {
$save['child_game_permission'] = I('post.child_game_permission');
$saveRes = D('Promote')->where(array('id' => PID))->save($save);
if ($saveRes === false) {
$data['status'] = 0;
$data['msg'] = '保存失败';
} else {
$data['status'] = 1;
$data['msg'] = '保存成功';
}
$this->ajaxReturn($data);
} else {
if ($res) {
$map['id'] = PID;
$promoteData = D('Promote')->field('id,child_game_permission')->where($map)->find();
$this->assign('data', $promoteData);
}
$this->meta_title = "设置";
$this->display();
}
}
}

@ -0,0 +1,240 @@
<extend name="Public/promote_base"/>
<block name="css">
<link rel="stylesheet" href="__CSS__/20170831/select2.min.css" type="text/css"/>
<link href="__CSS__/20180207/data.css" rel="stylesheet">
<link href="__CSS__/20180207/game.css" rel="stylesheet">
<link href="__CSS__/20180207/finance.css" rel="stylesheet">
<link href="__CSS__/game_detailed.css" rel="stylesheet">
<link href="__CSS__/detailed.css?v=1.1" rel="stylesheet">
<link href="__STATIC__/icons_alibaba/iconfont.css" rel="stylesheet">
<style type="text/css">
.trunk-list {
position: relative;
min-height: 66vh;
}
.pagenation {
text-align: center;
line-height: 5vh;
}
.lwx_dialog_prompt .layui-layer-content {
padding-top: 15px;
}
.lwx_dialog_title {
margin: 0;
padding: 0;
}
.launch_platform_prompt .layui-layer-input, .lwx_dialog_input, .lwx_dialog_select, .lwx_dialog_textarea {
display: block;
width: 220px;
height: 32px;
margin: 0 auto;
line-height: 32px;
padding: 0 5px;
border: 1px solid #ccc;
box-shadow: 1px 1px 5px rgba(0, 0, 0, .1) inset;
color: #333;
}
.lwx_dialog_select {
width: 272px;
}
.lwx_dialog_textarea {
height: 64px;
width: 260px;
margin-top: 10px;
resize: none;
}
.lwx_dialog_input {
width: 260px;
margin-top: 10px;
}
.launch_platform_prompt .layui-layer-btn, .lwx_dialog_prompt .layui-layer-btn {
text-align: center;
padding-bottom: 25px;
}
.launch_platform_prompt .layui-layer-btn .layui-layer-btn0, .lwx_dialog_prompt .layui-layer-btn .layui-layer-btn0 {
width: 81%;
line-height: 32px;
height: 32px;
margin: 0;
}
.lwx_dialog_notice {
position: absolute;
bottom: 6px;
left: 20px;
font-size: 12px;
color: #999;
}
.lwx_dialog_prompt .select2-container, .select2-container--default .select2-selection--single {
width: 272px !important;
}
.applycbtn {
display: block;
color: #50B370;
}
textarea {
font-family: inherit;
}
.trunk-content {
margin: 0 2%;
}
.pic-prev:hover, .pic-next:hover {
background-color: #4ac5c3;
}
.add-disable {
color: #999;
}
.input-number {
width: 80px;
text-align: center;
}
.input-security {
width: 500px;
height: 2.5rem;
padding-left: 10px;
border-radius: 5px;
border: 0;
}
.btn-security {
width: 300px;
height: 2.4rem;
border: 0;
border-radius: 5px;
background-color: #358fe4;
color: #fff;
}
.btn-security-close {
width: 300px;
height: 2.4rem;
border: 0;
border-radius: 5px;
background-color: #fff;
color: #999;
}
</style>
</block>
<block name="body">
<div class="page-list normal_list apply-index-list">
<div class="trunk-title">
<div class="location">
<div class="location-container">当前位置:<span>游戏管理></span><span>设置</span></div>
</div>
<if condition="isset($data)">
<img src="__IMG__/20180207/icon_normal_game.png"><span class="title_main">设置</span>
<else/>
<span class="title_main">安全密码</span>
</if>
</div>
<div class="trunk-content article">
<div class="trunk-search clearfix" style="display: table-caption;">
<if condition="isset($data)">
<div class="tab detailed-box" style="margin-top: 40px;align-items: center;">
<label class="detailed-title detailed-label" style="margin-right: 20px;width: 200px;">下级账号游戏展示:</label>
<div class="detailed-content-box">
<label style="margin-right: 20px;">
<input name="child_game_permission" value="1" type="radio" <if condition="$data.child_game_permission eq 1">checked</if>> 所有游戏
</label>
<label>
<input name="child_game_permission" value="0" type="radio" <if condition="$data.child_game_permission eq 0">checked</if>> 会长已添加游戏
</label>
</div>
</div>
<div class="tab detailed-box">
<label class="detailed-title detailed-label" style="margin-right: 20px;width: 200px;"></label>
<div class="detailed-content-box" style="display: flex;">
<button class="btn-security" id="btn_save" style="margin-right: 20px;width: 200px;">保存</button>
</div>
</div>
<else/>
<div class="tab detailed-box" style="margin-top: 40px;align-items: center;">
<label class="detailed-title detailed-label" style="margin-right: 20px;">安全密码:</label>
<div class="detailed-content-box">
<input class="input-security" id="security_password" type="password" placeholder="安全密码">
</div>
</div>
<div class="tab detailed-box">
<label class="detailed-title detailed-label" style="margin-right: 20px;"></label>
<div class="detailed-content-box" style="display: flex;width: 100%;">
<button class="btn-security" id="btn_security" style="margin-right: 20px;">确定</button>
<button class="btn-security-close" id="btn_security_close">取消</button>
</div>
</div>
</if>
</div>
</div>
</div>
</block>
<block name="script">
<script src="__STATIC__/zeroclipboard/jquery.zclip.min.js"></script>
<script type="text/javascript" src="__JS__/20170831/select2.min.js"></script>
<script type="text/javascript">
$(document).ready(function () {
$('#btn_security').on('click', function () {
var password = $('#security_password').val();
$.ajax({
type: "post",
url: "{:U('GameDivide/verifyPassword')}",
dataType: "json",
data: {'password': password},
success: function (data) {
if (data.status == 1) {
window.location.reload();
} else {
layer.msg(data.msg, {icon: 5});
}
},
error: function (result) {
layer.msg('网络异常', {icon: 5});
}
});
});
$('#btn_security_close').on('click', function () {
window.location.href = "{:U('Promote/index')}";
});
$('#btn_save').on('click', function () {
var childGamePermission = $('input[name=child_game_permission]:checked').val();
$.ajax({
type: "post",
url: "{:U('setChildGamePermission')}",
dataType: "json",
data: {'child_game_permission': childGamePermission},
success: function (data) {
if (data.status == 1) {
layer.msg(data.msg, {icon: 1});
} else {
layer.msg(data.msg, {icon: 5});
}
},
error: function (result) {
layer.msg('网络异常', {icon: 5});
}
});
});
});
</script>
</block>

@ -74,6 +74,7 @@
<a href="{:U('Apply/gameList')}" class="<if condition='CONTROLLER_NAME eq Apply and (ACTION_NAME eq gameList or ACTION_NAME eq myGameList) '>active</if> ">混服管理</a>
<if condition="getParentPromoteId(PID) eq 0">
<a href="{:U('GameDivide/index')}" class="<if condition='CONTROLLER_NAME eq GameDivide and (ACTION_NAME eq index) '>active</if> ">分成比例</a>
<a href="{:U('Promote/setChildGamePermission')}" class="<if condition='CONTROLLER_NAME eq Promote and (ACTION_NAME eq setChildGamePermission) '>active</if> ">设置</a>
</if>
</div>

@ -67,3 +67,8 @@ 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`;
-- ----------------------------
-- 2019-10-10 cxj
-- ----------------------------
ALTER TABLE `tab_promote` ADD COLUMN `child_game_permission` tinyint(2) NOT NULL DEFAULT 0 COMMENT '下级游戏添加权限 0-本账号已添加游戏 1-所有游戏' AFTER `idcard`;
Loading…
Cancel
Save