管理后台>推广员管理>公会分成管理--更新

master
chenxiaojun 5 years ago
parent 4c05a682b3
commit aa5e404188

@ -668,4 +668,50 @@ function getAllGameList($groupByRelation = false)
$games = M('game', 'tab_')->field($field)->select(); $games = M('game', 'tab_')->field($field)->select();
} }
return $games; return $games;
}
//获取管理员权限列表
function getAdminRules($adminId)
{
$rules = [];
if ($adminId) {
$groupId = M('auth_group_access')->where(array('uid' => intval($adminId)))->getField('group_id');
if ($groupId) {
$rules = M('auth_group')->where(array('id' => $groupId))->getField('rules');
$rules = explode(',', $rules);
}
}
return $rules;
}
//获取权限id
function getRule($name, $module)
{
$ruleId = 0;
if ($name) {
if ($module) {
$map['module'] = $module;
}
$map['name'] = trim($name);
$ruleId = M('auth_rule')->where($map)->getField('id');
}
return $ruleId;
}
//下划线转驼峰 $littleHump 是否转换成小驼峰
function camelize($str, $separator = '_', $littleHump = false)
{
if ($littleHump) {
$str = $separator . str_replace($separator, " ", strtolower($str));
} else {
$str = str_replace($separator, " ", strtolower($str));
}
return ltrim(str_replace(" ", "", ucwords($str)), $separator );
}
//驼峰转下划线
function unCamelize($str, $separator = '_')
{
return strtolower(preg_replace('/([a-z])([A-Z])/', "$1" . $separator . "$2", $str));
} }

@ -112,12 +112,14 @@ class PromoteGameRatioController extends ThinkController
} }
} }
// var_dump(get_defined_constants());die; $reviewRule = $this->getReviewRule();
$this->assign('records', $records); $this->assign('records', $records);
$this->assign('count', $count); $this->assign('count', $count);
$this->assign('gameList', getAllGameList()); $this->assign('gameList', getAllGameList());
$this->assign('promoteList', getPromoteByLevel(1)); $this->assign('promoteList', getPromoteByLevel(1));
$this->assign('statusList', self::$statusList); $this->assign('statusList', self::$statusList);
$this->assign('reviewRule', $reviewRule);
$this->meta_title = '公会分成管理'; $this->meta_title = '公会分成管理';
$this->display(); $this->display();
} }
@ -200,6 +202,8 @@ class PromoteGameRatioController extends ThinkController
{ {
$params = I('post.'); $params = I('post.');
$ids = $params['ids'] ?? []; $ids = $params['ids'] ?? [];
$remark = $params['remark'] ?? '';
var_dump($remark);die;
if (empty($ids)) { if (empty($ids)) {
$this->error('操作失败'); $this->error('操作失败');
} }
@ -213,6 +217,9 @@ class PromoteGameRatioController extends ThinkController
$save['reviewer_id'] = is_login(); $save['reviewer_id'] = is_login();
$save['review_time'] = $time; $save['review_time'] = $time;
$save['update_time'] = $time; $save['update_time'] = $time;
if ($remark) {
$save['remark'] = $remark;
}
$result = D(self::MODEL_NAME)->where($map)->save($save); $result = D(self::MODEL_NAME)->where($map)->save($save);
if ($result) { if ($result) {
$this->success('操作成功'); $this->success('操作成功');
@ -229,6 +236,16 @@ class PromoteGameRatioController extends ThinkController
return $createTime; return $createTime;
} }
private function getReviewRule()
{
$rules = getAdminRules(is_login());
$rulesName = BIND_MODULE . '/' . CONTROLLER_NAME . '/setStatus';
$ruleId = getRule($rulesName, 'admin');
$reviewRule = in_array($ruleId, $rules) ? true : false;
$reviewRule = (is_login() == 1) ? true : $reviewRule;
return $reviewRule;
}
public function getGameRatio() public function getGameRatio()
{ {
$gameId = I('post.game_id', 0); $gameId = I('post.game_id', 0);

@ -7,6 +7,8 @@
<script src="__STATIC__/layer/layer.js"></script> <script src="__STATIC__/layer/layer.js"></script>
<script type="text/javascript" src="__JS__/bootstrap.min.js"></script> <script type="text/javascript" src="__JS__/bootstrap.min.js"></script>
<script type="text/javascript" src="__JS__/select2.min.js"></script> <script type="text/javascript" src="__JS__/select2.min.js"></script>
<script type="text/javascript" src="__STATIC__/layer/extend/layer.ext.js"></script>
<link rel="stylesheet" href="__CSS__/promote.css" type="text/css"/>
<style> <style>
.select2-container--default .select2-selection--single { .select2-container--default .select2-selection--single {
color: #000; color: #000;
@ -29,6 +31,16 @@
} }
.select2-results__option[aria-selected] {font-size:12px;} .select2-results__option[aria-selected] {font-size:12px;}
.layui-layer-dialog .layui-layer-content{color:red} .layui-layer-dialog .layui-layer-content{color:red}
.textarea-style {
width: 200px;
height: 150px;
}
.mustmark {
color: #FF0000;
font-style: normal;
margin: 0 3px;
margin-left:-7px
}
</style> </style>
<div class="cf main-place top_nav_list navtab_list"> <div class="cf main-place top_nav_list navtab_list">
@ -41,8 +53,10 @@
<div class="tools"> <div class="tools">
<empty name="show_status"> <empty name="show_status">
<a class=" " href="{:U('applyRatio?model='.$model['id'])}"><span class="button_icon button_icon1"></span>游戏分成比例申请</a> <a class=" " href="{:U('applyRatio?model='.$model['id'])}"><span class="button_icon button_icon1"></span>游戏分成比例申请</a>
<a class="ajax-post " target-form="ids" url="{:U('setStatus',array('status'=>1))}"><span class="button_icon button_icon9"></span>审核通过</a> <if condition = "$reviewRule">
<a class="ajax-post " style="color: red;" target-form="ids" url="{:U('setStatus',array('status'=>-1))}"><span class="button_icon button_icon9"></span>审核拒绝</a> <a class="ajax-post " target-form="ids" url="{:U('setStatus',array('status'=>1))}"><span class="button_icon button_icon9"></span>审核通过</a>
<a href="javascript:;" onclick="refuse()" style="color: red;"><span class="button_icon button_icon9"></span>审核拒绝</a>
</if>
</empty> </empty>
</div> </div>
</div> </div>
@ -157,7 +171,24 @@
</form> </form>
<a class="ajax-post add-butn <notempty name='commonset'>addSIsetted</notempty>" href="javascript:;" target-form="addShortcutIcon" url="{:U('Think/addShortcutIcon')}"><img src="__IMG__/zwmimages/icon_jia.png"><span><notempty name='commonset'>已添加<else />添加至常用设置</notempty></span></a> <a class="ajax-post add-butn <notempty name='commonset'>addSIsetted</notempty>" href="javascript:;" target-form="addShortcutIcon" url="{:U('Think/addShortcutIcon')}"><img src="__IMG__/zwmimages/icon_jia.png"><span><notempty name='commonset'>已添加<else />添加至常用设置</notempty></span></a>
</div> </div>
<!--弹出层-->
<div class="promote-layer mb20">
<form id="ajaxForm" action="{:U('set_withdraw')}" method="post">
<input type="hidden" name="ids" id="hd_ids" value="" />
<input type="hidden" name="case" id="case" value="deny" />
<ol class="promote-con">
<li class="promote-con-con " id="deny">
<div class="mb20">
<span class="promote-name"><i class="mustmark">*</i>备注:</span>
<textarea class="textarea-style" name="remark"></textarea>
</div>
<a class="ajax-post" id="agree_btn" target-form="ids" url="{:U('setStatus',array('status'=>-1))}"><div class="promote-btn">拒绝</div></a>
</li>
</ol>
</form>
</div>
</block> </block>
<block name="script"> <block name="script">
@ -191,63 +222,26 @@ $(function(){
$("#search").click(); $("#search").click();
} }
}); });
$("#admin").on('click',function(event) {
var navlist = $(this).find('.i_list_li');
if (navlist.hasClass('hidden')) {
navlist.removeClass('hidden');
$(this).find('#i_list_id').focus().val('');
} else {
navlist.addClass('hidden');
}
$(document).one("click", function(){
navlist.addClass('hidden');
});
event.stopPropagation();
});
$('#admin #i_list_id').on('keyup',function(event) {
var val = $.trim($(this).val()).toLowerCase();
$(this).closest('.drop-down').find('#i_list_idh').val(val);
});
$("#admin #i_list_li").find("a").each(function(){
$(this).click(function(){
var text = $.trim($(this).text()).toLowerCase();
$(this).closest('.drop-down').find("#i_list_id").val(text);
$(this).closest('.drop-down').find('#i_list_idh').val(text);
})
});
/* 状态搜索子菜单 */
/*渠道删除*/
$('.delete').click(function(){
var id = $(this).attr('data-id');
layer.confirm('渠道删除后,下级渠道同时被删除,所属数据归属于自然渠道!', {
title:'确定要删除该渠道?',
icon:0,
btn: ['删除','取消'] //按钮
}, function(){
$.ajax({
type: "POST",
url: "{:U('del_promote')}",
dataType: 'json',
async: false,
data: {id:id},
success:function(data){
if(data.status==1){
layer.msg(data.msg);
setTimeout(function(){
window.location.reload();
},1500);
}
}
});
}, function(){
layer.close();
});
})
}) })
function refuse() {
if ($('.ids[type=checkbox]:checked').length > 0) {
layer.open({
type: 1,
title: '审核拒绝',
shadeClose: true,
shade: 0.8,
area: ['387px', '500px'],
content: $('.promote-layer')
});
$('#deny').addClass('promote-show');
} else {
updateAlert('请选择需要操作的数据','tip_error');
setTimeout(function(){
$('#tip').find('.tipclose').click();
},1500);
}
}
</script> </script>
<script type="text/javascript"> <script type="text/javascript">
//点击字母按照条件按钮筛选 //点击字母按照条件按钮筛选
@ -341,21 +335,5 @@ $(function(){
$(".jsgamecheckall").click(function(){ $(".jsgamecheckall").click(function(){
$(this).closest('.jsgamecheckallbox').siblings("#game_list").find(".jsgameid").prop("checked", this.checked); $(this).closest('.jsgamecheckallbox').siblings("#game_list").find(".jsgameid").prop("checked", this.checked);
}); });
//可申请游戏 全选及全选反选 功能 @author zwm date 20180604
function jsgameid(){
$(".jsgameid").click(function(){
var option = $(this).closest('ul').find(".jsgameid"),
checkall = $(this).closest('ul').siblings('.jsgamecheckallbox').find('.jsgamecheckall');
option.each(function(i){
if(!this.checked){
checkall.prop("checked", false);
return false;
}else{
checkall.prop("checked", true);
}
});
});
}
</script> </script>
</block> </block>

Loading…
Cancel
Save