application/admin/controller/ManagerRole.php

(开头部分) 4KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

<?php
namespace app\admin\controller;
use app\admin\model\AuthGroup;
use app\admin\model\AuthRule;

class ManagerRole extends Base {

    public function index() {
          $this->assign('p_title', $this->hy_lang('role_list'));  
        $Group = new AuthGroup();
      // 查询数据集
        $AuthGroup = $Group->order('id', 'desc')->select();
        $this->assign('AuthGroup', $AuthGroup);
        return $this->fetch();
    }
      //修改角色属性 的页面
     public function add_role() {
          $rule = new AuthRule();
          $AuthRule = $rule->order('name', 'desc')->select();
       
     $arr=$this->get_role_array($AuthRule);
         $this->assign('arr_k', $arr['key']);
        $this->assign('arr_new', $arr['value']);
        $this->assign('AuthRule', $AuthRule);
        return $this->fetch();
    }
       //修改当前页面角色属性
     public function add_role_action() {
        $Group = new AuthGroup;
         $Group->title = request()->param('value');
         $Group->rules = request()->param('name');
         $Group->update_time = time();
          $Group->save();
    }
    
    //编辑角色页面
    public function edit_role() {
          $rule = new AuthRule();
          $AuthRule = $rule->order('name', 'desc')->select();
          //根据传来角色id输出该角色data
          $gourp_one=AuthGroup::get(['id' =>request()->param('id')]); 
          $role_rules_arr=explode(",", $gourp_one['rules']);
      //重组数组    
      $arr=$this->get_role_array($AuthRule);
     
              $this->assign('title', request()->param('title'));
        $this->assign('arr_k',$arr['key']);
        $this->assign('arr_new',$arr['value']);
        $this->assign('AuthRule',$AuthRule);
        $this->assign('role_rules_arr',$role_rules_arr);
         $this->assign('role_title',$gourp_one['title']);
          $this->assign('role_id',$gourp_one['id']);
        
        return $this->fetch();
    }
    //编辑角色动作
        public function edit_role_action() {
        $gourp_one=AuthGroup::get(['id' =>request()->param('id')]); 
//        //写入数据库角色行  权限名字符串
         $gourp_one->title = request()->param('value');
后面还有 60 行代码,解锁后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。