计算出一个人在 MediaWiki 上完成的更改的百分比

发布于 2024-12-09 06:23:40 字数 76 浏览 1 评论 0原文

我想计算出一个人对一篇文章进行编辑/更改的百分比,这样我就可以相应地发出捐款。

我如何自动执行此操作? (最好是 PHP)

I would like to work out the percentage of editing/change that one person has done to one article, so I can send out donations accordingly.

How do I do this automatically? (preferably in PHP)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

挽手叙旧 2024-12-16 06:23:40

编辑历史记录存储在revision 表中。如果您有 page-id,则可以按页面获取用户编辑的百分比(只需将 1 替换为 page-id):

SELECT
    rev_user, rev_user_text,
    count(*) as rev_user_count,
    (SELECT count(*) FROM revision WHERE rev_page = 1) as rev_total_count,
    100 * count(*)/(SELECT count(*) FROM revision WHERE rev_page = 1) as rev_percent
FROM revision
WHERE rev_page = 1
GROUP BY rev_user

The editing history is stored in the revision table. If you have the page-id you can get the percentage of user edits by page (just replace the 1 with the page-id):

SELECT
    rev_user, rev_user_text,
    count(*) as rev_user_count,
    (SELECT count(*) FROM revision WHERE rev_page = 1) as rev_total_count,
    100 * count(*)/(SELECT count(*) FROM revision WHERE rev_page = 1) as rev_percent
FROM revision
WHERE rev_page = 1
GROUP BY rev_user
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文