mysql - Use PHP to write a message board with a reply function that needs to be written to the database.
大家讲道理
大家讲道理 2017-05-24 11:34:30
0
2
818

Function Description

The front-end is a mobile APP. When customers have questions and provide feedback, the back-end administrator can receive the feedback and respond.
The project is developed based on thinkphp v3.2.

Front-end and back-end screenshots

Above picture -- front-end feedback

Above picture -- Administrators can receive feedback information and reply or delete it.

Database screenshot

Currently, only one message form has been designed. User feedback information will be recorded in this form, and background feedback records are also found from this form.

question

Now the message function has been implemented, but I don’t know how to implement the reply function, I don’t know where to start with the PHP code, and I don’t know how to design the table.

Please enlighten me!

大家讲道理
大家讲道理

光阴似箭催人老,日月如移越少年。

reply all (2)
阿神

Create another table and then connect it with the primary and foreign keys. Of course, it doesn’t matter if you don’t connect it. You can write your own method to query the reply data.

    为情所困

    First, it is best not to design it in the same table as the feedback information table.
    Second, it is best to add an additional field status to your feedback form to indicate whether the message has been replied to.
    Feedback form design
    id[int(11)]Primary key
    suggest_id[int(11)]Feedback form id
    aid[int(11)]Feedback person id
    content[text]Feedback information
    isuseful[enum(0,1) )] Whether useful 0 No 1 No
    time [int(11)] Reply time
    isread[enum(0,1)] Whether it has been read
    rbtime[int(11)] Feedback time, feedback whether this reply message is useful

    When feedback information enters the background, the operator can click the reply button to reply to the corresponding information. When the operator clicks send, all relevant reply data is saved to the database. And update the status of the feedback form so that the feedback information cannot be written again. At this point, the background operations have been completed. But it is important that the main user knows that there is a feedback information form to prompt after entering the app, and your feedback information has the latest reply. This requires writing the relevant information into the push table or push queue after writing the reply data to the database. After the user enters the interface, he or she can see the latest record prompt. Of course, after users read the relevant reply information, they can choose whether the reply information is helpful to them, etc. . .

      Latest Downloads
      More>
      Web Effects
      Website Source Code
      Website Materials
      Front End Template
      About us Disclaimer Sitemap
      php.cn:Public welfare online PHP training,Help PHP learners grow quickly!