业务经理

微信扫描以上二维码

028-61286886

技术咨询

如何才能在评论里拿到name呢用户昵称

迅睿框架 更新 2021-07-22 09:25:50

请问  如何才能在评论里拿到name呢   用户昵称和评论回复里的@账号 能否换成用户昵称 求大佬们帮帮忙  谢谢


image




image




public function output_comment($data) {

        $rt = [];

        // 这里根据项目的$data输出格式来定义PHP的数据写法,

        // 每个接口的写法几乎不一样,下面是测试例子

        

        if ($data['list']) {

            foreach ($data['list'] as $t) {

                $c = [

                    'avatar'=> dr_avatar($t['uid']),//用户头像

                    'author' => $t['author'], // 账号

                    'title' => $t['title'], // 昵称

                    'comments' => $t['comments'],//评论总数

                    'support' => $t['support'],//点赞总数

                    'id' => $t['id'], // 评论id号

                    'content' => dr_replace_emotion($t['content']), // 评论内容

                    'inputtime' => dr_date($t['inputtime'], 'Y-m-d H:i:s'), // 时间转换

                ];

                //回复评论

                if ($t['rlist']) {

                 $r['rlist'] = [];

                 foreach ($t['rlist'] as $tt) {

                 $c['rlist'][] = [

                    'avatar'=> dr_avatar($tt['uid']),//用户头像

                    'author' => $tt['author'], // 账号

                    'title' => $tt['title'], // 昵称

                    'comments' => $tt['comments'],//评论总数

                    'support' => $tt['support'],//点赞总数

                    'id' => $tt['id'], // 评论id号

                    'content' => dr_replace_emotion($tt['content']), // 评论内容

                    'inputtime' => dr_date($tt['inputtime'], 'Y-m-d H:i:s'), // 时间转换

                ];

                 }

                    

                }

                $rt[] = $c;

            }

        }

        return $rt;

    }



插件版权:官方插件
插件名称:评论系统

方案

  • 官方插件技术-李译 #1 · 2021-07-21 12:29:40
    满意答案
    public function output_comment($data) {
            $rt = [];
            // 这里根据项目的$data输出格式来定义PHP的数据写法,
            // 每个接口的写法几乎不一样,下面是测试例子
            
            if ($data['list']) {
                foreach ($data['list'] as $t) {
                    $user = dr_member_info($t['uid']);
                    $c = [
                        'avatar'=> dr_avatar($t['uid']),//用户头像
                        'author' => $user['name'], // 账号
                        'title' => $t['title'], // 昵称
                        'comments' => $t['comments'],//评论总数
                        'support' => $t['support'],//点赞总数
                        'id' => $t['id'], // 评论id号
                        'content' => dr_replace_emotion($t['content']), // 评论内容
                        'inputtime' => dr_date($t['inputtime'], 'Y-m-d H:i:s'), // 时间转换
                    ];
                    //回复评论
                    if ($t['rlist']) {
                     $r['rlist'] = [];
                     foreach ($t['rlist'] as $tt) {
                    $user = dr_member_info($tt['uid']);
                     $c['rlist'][] = [
                        'avatar'=> dr_avatar($tt['uid']),//用户头像
                        'author' => $user['name'], // 账号
                        'title' => $tt['title'], // 昵称
                        'comments' => $tt['comments'],//评论总数
                        'support' => $tt['support'],//点赞总数
                        'id' => $tt['id'], // 评论id号
                        'content' => dr_replace_emotion($tt['content']), // 评论内容
                        'inputtime' => dr_date($tt['inputtime'], 'Y-m-d H:i:s'), // 时间转换
                    ];
                     }
                        
                    }
                    $rt[] = $c;
                }
            }
            return $rt;
        }
  • #2 · 2021-07-22 09:25:50
    @官方插件技术-李译:已解决已解决 谢谢

迅睿系统漏洞

导入微信文章
导入微信文章(2026-09-15)
优化排版缺少文字情况
GEO系统
GEO系统(2026-09-15)
运营客户端,防止误触阴影处关闭对话框
独立站群系统
独立站群系统(2026-09-14)
子站独立部署时修复同步附件失败问题
在线客服
在线客服(2026-09-13)
修复删除会话报错问题 删除会话时联动删除聊天图片
在线考试竞赛系统
在线考试竞赛系统(2026-09-12)
增加投票功能 考试功能拓展 注意:更新后需要执行系统更新,更新数...
网上信箱
网上信箱(2026-09-12)
修复新版本兼容问题
GeoSeo收录宝
GeoSeo收录宝(2026-09-12)
1 优化Update.php文件,解决版本在线升级不完整问题 2 ...
GeoSeo工具箱
GeoSeo工具箱(2026-09-11)
修正历史记录推送
微信系统
微信系统(2026-09-11)
增加数据统计总览界面 账号管理增加服务和公众号的区别 菜单管理支持更...
答题系统
答题系统(2026-09-11)
一站式在线答题系统,支持真题考试、题库练习和错题本,适合培训、考证、...