易优CMS调用会员阅读权限的名称函数

wdzsjl 2个月前 (10-10) 阅读数 13 #WordPress
网站根目录extend/function.php文件内写入  if (!function_exists('diy_getArcrank')){    //显示文档的会员阅读权限名称    function diy_getArcrank($arcrank = '')    {        static $users_level_list = [];        if (empty($users_level_list)) {           $users_level_list = \think\Db::name('users_level')->field('level_name,level_value')              ->where('lang', get_current_lang())              ->order('is_system desc, level_value asc')              ->getAllWithIndex('level_value');        }        if (!empty($users_level_list[$arcrank])) {           return $users_level_list[$arcrank]['level_name'];        } else if (empty($arcrank)) {           $firstUserLevel = current($users_level_list);           return $firstUserLevel['level_name'];        } else {        return '';        }     } }

 

wx.jpg ywfw.jpg
热门