找到最后原来auth类中的问题 需要改改
以下是自己改动(大神勿喷)
auth类中
getGroups方法 修改如下
public function getGroups($uid) {
static $groups = array();
if (isset($groups[$uid]))
return $groups[$uid];
/*$user_groups = M()
//->db(1,"DB_CONFIG1")
->table($this->_config['AUTH_GROUP_ACCESS'] . ' a')
->where("a.uid='$uid' and g.status='1'")
->join($this->_config['AUTH_GROUP']." g on a.group_id=g.id")
->field('uid,group_id,title,rules')->select();
原来的方法 config中配置多个数据库时不能正常运行
*/
//修改后的方法 配置多个数据库 是可以使用
$m=M('auth_group_access','wx_','DB_CONFIG1');
$sqlgroup="select a.uid,a.group_id,g.title,g.rules from ".
$this->_config['AUTH_GROUP_ACCESS']." as a, ".
$this->_config['AUTH_GROUP']." as g where a.uid='1'
and g.status='1' and a.group_id=g.id ";
$user_groups=$m->query($sqlgroup);
$groups[$uid]=$user_groups?:array();
return $groups[$uid];
}getAuthList()方法修改 如下找到如下
//读取用户组所有权限规则
/* $rules = M($this->_config['AUTH_RULE'],'','DB_CONFIG1')->
table($this->_config['AUTH_RULE'])->where($map)
->field('condition,name')->select(); */
$rules = M($this->_config['AUTH_RULE'],'','DB_CONFIG1')->
where($map)->field('condition,name')->select();
getUserInfo($uid)方法修改如下/* $userinfo[$uid]=M()->where(array('uid'=>$uid))
->table($this->_config['AUTH_USER'])->find(); */
$userinfo[$uid]=M(($this->_config['AUTH_USER']),'','DB_CONFIG1')
->where(array('uid'=>$uid))->find(); 最佳答案