From aa5e404188d8709cac0665c153df42152192d370 Mon Sep 17 00:00:00 2001 From: chenxiaojun <956334972@qq.com> Date: Thu, 19 Dec 2019 14:35:54 +0800 Subject: [PATCH] =?UTF-8?q?=E7=AE=A1=E7=90=86=E5=90=8E=E5=8F=B0>=E6=8E=A8?= =?UTF-8?q?=E5=B9=BF=E5=91=98=E7=AE=A1=E7=90=86>=E5=85=AC=E4=BC=9A?= =?UTF-8?q?=E5=88=86=E6=88=90=E7=AE=A1=E7=90=86--=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Application/Admin/Common/function.php | 46 +++++++ .../PromoteGameRatioController.class.php | 19 ++- .../Admin/View/PromoteGameRatio/lists.html | 126 ++++++++---------- 3 files changed, 116 insertions(+), 75 deletions(-) diff --git a/Application/Admin/Common/function.php b/Application/Admin/Common/function.php index eca80c14c..101a8db89 100644 --- a/Application/Admin/Common/function.php +++ b/Application/Admin/Common/function.php @@ -668,4 +668,50 @@ function getAllGameList($groupByRelation = false) $games = M('game', 'tab_')->field($field)->select(); } 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)); } \ No newline at end of file diff --git a/Application/Admin/Controller/PromoteGameRatioController.class.php b/Application/Admin/Controller/PromoteGameRatioController.class.php index 137c63913..f2981a573 100644 --- a/Application/Admin/Controller/PromoteGameRatioController.class.php +++ b/Application/Admin/Controller/PromoteGameRatioController.class.php @@ -112,12 +112,14 @@ class PromoteGameRatioController extends ThinkController } } -// var_dump(get_defined_constants());die; + $reviewRule = $this->getReviewRule(); + $this->assign('records', $records); $this->assign('count', $count); $this->assign('gameList', getAllGameList()); $this->assign('promoteList', getPromoteByLevel(1)); $this->assign('statusList', self::$statusList); + $this->assign('reviewRule', $reviewRule); $this->meta_title = '公会分成管理'; $this->display(); } @@ -200,6 +202,8 @@ class PromoteGameRatioController extends ThinkController { $params = I('post.'); $ids = $params['ids'] ?? []; + $remark = $params['remark'] ?? ''; + var_dump($remark);die; if (empty($ids)) { $this->error('操作失败'); } @@ -213,6 +217,9 @@ class PromoteGameRatioController extends ThinkController $save['reviewer_id'] = is_login(); $save['review_time'] = $time; $save['update_time'] = $time; + if ($remark) { + $save['remark'] = $remark; + } $result = D(self::MODEL_NAME)->where($map)->save($save); if ($result) { $this->success('操作成功'); @@ -229,6 +236,16 @@ class PromoteGameRatioController extends ThinkController 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() { $gameId = I('post.game_id', 0); diff --git a/Application/Admin/View/PromoteGameRatio/lists.html b/Application/Admin/View/PromoteGameRatio/lists.html index b82ce950e..f40446030 100644 --- a/Application/Admin/View/PromoteGameRatio/lists.html +++ b/Application/Admin/View/PromoteGameRatio/lists.html @@ -7,6 +7,8 @@ + + @@ -157,7 +171,24 @@ 已添加添加至常用设置 - + + +
+
+ + + +
    +
  1. +
    + *备注: + +
    +
    拒绝
    +
  2. +
+
+
@@ -191,63 +222,26 @@ $(function(){ $("#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); + } +}