fix: 修复文章详情没有评论数据显示问题

This commit is contained in:
2025-06-07 15:00:46 +08:00
parent 550a70fdd4
commit 6e8327424c
3 changed files with 171 additions and 153 deletions

View File

@@ -99,6 +99,21 @@ class Article extends Common
$share_config = $this->getSysConfig($this->lang_id, ['article_share']);
View::assign('share_config', $share_config['article_share']);
// 获取文章评论数据
$comments = ArticleLeaveMessageModel::field([
'id',
'name',
'email',
'content',
'created_at'
])
->article($id)
->audited(true)
->order(['id' => 'desc'])
->limit(5)
->select();
View::assign('comments', $comments);
// 获取倒序或发布时间倒序3篇文章做为推荐文章
$recommends = ArticleModel::field([
'id',