最初,我是这样实现的,执行的那个模块,加上这句即可;
//add by wangtongphp 获取用户组的信息 if($user['gid']){ $user['u_group'] = FDB::fetchFirst("select * from ".FDB::table('user_group')." where gid = ".$user['gid']); }
后来才发现,全局的$_FANWE里面有用户组信息,不过是登录用户当前信息,$_FANWE['user_group'],输出如下:
array(13) { ["gid"]=> string(1) "7" ["name"]=> string(12) "普通会员" ["type"]=> string(6) "system" ["is_special"]=> string(1) "0" ["is_admin"]=> string(1) "0" ["stars"]=> string(1) "0" ["color"]=> string(0) "" ["icon"]=> string(0) "" ["credits_higher"]=> string(4) "1000" ["credits_lower"]=> string(1) "0" ["commission_rate"]=> string(5) "10.00" ["buy_rate"]=> string(5) "10.00" ["status"]=> string(1) "1" }