移除旧版 HTML 模板与兼容层,并完善私信、举报、媒体存储与 SEO。
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -32,7 +32,9 @@ func (s *BoardService) ListWithStats() ([]BoardWithStats, error) {
|
||||
result := make([]BoardWithStats, len(boards))
|
||||
for i, b := range boards {
|
||||
var count int64
|
||||
model.DB.Model(&model.Post{}).Where("board_id = ?", b.ID).Count(&count)
|
||||
model.DB.Model(&model.Post{}).
|
||||
Where("board_id = ? AND status = ?", b.ID, model.ContentStatusPublished).
|
||||
Count(&count)
|
||||
result[i] = BoardWithStats{Board: b, PostCount: int(count)}
|
||||
}
|
||||
return result, nil
|
||||
|
||||
Reference in New Issue
Block a user