审核 MySQL 表并仅在批准后显示更改

发布于 2024-10-20 22:10:06 字数 314 浏览 0 评论 0原文

我有一个小型 Web 应用程序,其中有一些表,用户可以在其中发布和编辑数据。我还有一个应用程序管理员来管理新发布或编辑的数据。我想做的是审核每个表并仅在管理员批准后才显示数据。

应用程序流程是这样的:用户在某个表中输入信息;管理员将被注意到,他将批准或拒绝该信息。如果批准,信息将显示在前端。一旦信息获得批准,以后就可以对其进行编辑。当用户编辑信息时,管理员会再次注意到,他必须批准或拒绝编辑的信息,但之前批准的信息必须仍然在网站上可用。

我还需要保留更改信息的每个版本(例如 v1、v2、v3 等)。

您认为,完成这项工作的最佳方式是什么?

谢谢。

I have a small web application with a few tables where users can post and edit data. I also have an application admin which moderates the new posted or edited data. What I would like to do is to audit each table and display the data only after the admin has approved it.

The application flow is something like this: a user enters an information in some table; the admin will be noticed and he will approve or reject that information. If the approves it, the information will be displayed in the front-end. Once an information is approved, it can be edited later. When a user edits an information, the admin gets noticed again and he has to approve or reject the edited information, but the previous approved information must be still available on the website.

I also need to keep each version of the changed information (something like v1, v2, v3 etc.).

In your opinion, what is the best way to make this work?

Thank you.

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

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

发布评论

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

评论(2

烂柯人 2024-10-27 22:10:06
  1. 使用字段 IS_FOR_DISPALY 默认 NO 的帖子来扩展您的表格。
  2. 创建包含以下字段的批准表:post_record_id、new_content、aprove_status、aprove_date、aprove_person、已输入...

    • 新帖子应转到 IS_FOR_DISPLAY = NO 的帖子和 APROVE_STATUS = NULL 的批准,
    • 管理员应该能够按 APROVE_STATUS 进行排序/查看,当为 NULL 时 - 做出决定,YES - 还应该更改 IS_FOR_DISPLAY = YES 并完成初始批准后流程
    • 编辑已批准的帖子时,应在 aprovals 表中创建包含新内容的新记录,APROVE_STATUS = NULL
    • 当管理员查看这些NULL时,通过比赛记录中的POST_REC_ID和IS_FOR_DISPLAY = YES应该知道有编辑,并根据新旧内容,谁,何时等做出决定,如果是,则旧内容可以存储在如果需要history表,新的内容应该放在posts表中,IS_FOR_DISPLAY已经是YES
    • 如果任何批准决定为“否” - 则不会更改帖子表

这只是一般工作流程

  1. Extend your table with posts for field IS_FOR_DISPALY default NO.
  2. Create table with approvals containing fields: post_record_id, new_content, aprove_status, aprove_date, aprove_person, entered ....

    • new post should go to posts with IS_FOR_DISPLAY = NO and to aprovals with APROVE_STATUS = NULL,
    • admin should be able to sort / view by APROVE_STATUS, when is NULL - make decision, YES - should also change IS_FOR_DISPLAY = YES and finish initial post aproval process
    • when aproved post is edited, new record should be created in aprovals table with new content, APROVE_STATUS = NULL
    • when admin will view for those NULLs, by POST_REC_ID and IS_FOR_DISPLAY = YES in match record should know there is EDIT, and based on old and new content, who, when etc. make decision, if YES old content could be stored in history table if needed, new content should be placed in posts table, IS_FOR_DISPLAY is already YES
    • if any of aprovals decision would be NO - no changes to post table

This is just general work flow

背叛残局 2024-10-27 22:10:06

创造历史和队列表?
编辑进入队列表,如果管理员批准队列->真实->历史...

make history and queue tables ?
edits go to queue table and if admin aproves queue->real->history...

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文