# 仪表盘新帖统计数据损坏

**URL:** <https://meta.discourse.org/t/dashboard-new-posts-statistics-broken/352599>\
**Category:** Bug\
**Created:** [2025年二月16日 21:43 UTC](https://meta.discourse.org/t/dashboard-new-posts-statistics-broken/352599 "2025-02-16T21:43:11Z")\
**Posts on this page:** 1\
**Showing post:** 13

<div class="post-metadata">

**Author:** ![martin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/martin/32/491371_2.png) [@martin](https://meta.discourse.org/u/martin)\
**Post date:** [2025年二月21日 03:43 UTC](https://meta.discourse.org/t/dashboard-new-posts-statistics-broken/352599/13 "2025-02-21T03:43:46Z")

</div>

好的，谢谢，这很有帮助，它表明数据本身丢失了，而不是前端有什么错误 🤔

此报告背后的 SQL 查询非常简单，如果您可以访问 [Data Explorer](https://meta.discourse.org/t/32566?silent=true) 或直接访问数据库，您可以尝试运行并调整此查询，看看它是否能为您提供任何数据：

```sql
SELECT 
  COUNT(*) AS "count_all", 
  date(posts.created_at) AS "date_posts_created_at" 
FROM 
  "posts" 
  INNER JOIN "topics" ON "topics"."deleted_at" IS NULL 
  AND "topics"."id" = "posts"."topic_id" 
WHERE 
  "posts"."deleted_at" IS NULL 
  AND (
    topics.archetype <> 'private_message'
  ) 
  AND (
    posts.created_at >= '2025-02-01' 
    AND posts.created_at <= '2025-02-28'
  ) 
  AND "posts"."post_type" = 1 
GROUP BY 
  date(posts.created_at) 
ORDER BY 
  date(posts.created_at)

```

这是报告代码本身：

> <https://github.com/discourse/discourse/blob/8596aa34c46071eb42ffbb9e19ad733d1765578e/app/models/concerns/reports/posts.rb#L7-L32>

恐怕在无法访问您的站点进行数据库挖掘的情况下，进一步调试会有些棘手。

---

_[View the full topic](https://meta.discourse.org/t/dashboard-new-posts-statistics-broken/352599)._
