- 修改获取后台登陆管理员id wwj\application\Common\Common\function.php get_current_admin_id()
function get_current_admin_id(){
//$uid = $_SESSION['ADMIN_ID']
$belong_admin = M('Users')->where(array('id'=>$_SESSION['ADMIN_ID']))->getField('belong_admin');
return $belong_admin;
}
2.修改侧边栏显示 /alidata/www/doll/application/Common/Model/MenuModel.class.php admin_menu()
public function admin_menu($parentid, $with_self = false) {
//父节点ID
$parentid = (int) $parentid;
$where = array('parentid' => $parentid, 'status' => 1);
$app_e = get_options("app_e");
$temp = array();
if($app_e['2'] != 1){
array_push($temp, '335');
}
if($app_e['11'] != 1){
array_push($temp, '340', '350');
}
if($app_e['13'] != 1){
array_push($temp, '343');
}
$where['id'] = array('not in',join(',',$temp));
$result = $this->where($where)->order(array("listorder" => "ASC"))->select();
if ($with_self) {
$result2[] = $this->where(array('id' => $parentid))->find();
$result = array_merge($result2, $result);
}
//权限检查
if ($_SESSION['ADMIN_ID'] == 1) {
//如果是超级管理员 直接通过
return $result;
}
$array = array();
foreach ($result as $v) {
//方法
$action = $v['action'];
//public开头的通过
if (preg_match('/^public_/', $action)) {
$array[] = $v;
} else {
if (preg_match('/^ajax_([a-z]+)_/', $action, $_match)){
$action = $_match[1];
}
$rule_name=strtolower($v['app']."/".$v['model']."/".$action);
if ( sp_auth_check($_SESSION['ADMIN_ID'],$rule_name)){
$array[] = $v;
}
}
}
return $array;
}
3.修改数据库
dl_menudl_auth_rule表 添加对应控制器和方法
4.修改加盟商控制器 将所属加盟商为自身id