javascript - Category editor retains previous category name
黄舟
黄舟 2017-06-30 09:52:43
0
2
1135

Now there is such a demand. Due to the unreasonable design of the previous classification, it is now necessary to edit the classification when the previous classification name (called the old classification name) is not in the editing classification drop-down list, but when querying it needs to be The old category names are displayed, and the questions under these old category names are retained in the MySQL database. How to achieve this? The classification table has fields such as id, pid, name, create_time, and desc

黄舟
黄舟

人生最曼妙的风景,竟是内心的淡定与从容!

reply all(2)
小葫芦

Add one more field to distinguish the old classification from the new classification,
or directly distinguish it through create_time.

三叔

You are right what you said above. In fact, there should be no problem with your data structure. I think you think there is a problem. It may be that the previous demand design conflicts with the current demand design. This is because the person who put forward the demand does not understand the development process. and details, which are caused by not taking into account the actual development situation.

For your current design, you can add an extra field to distinguish the old and new categories, such as is_new TINYINT(1). If it is an old category, the value of is_new is 0, just fill it in manually. When adding or modifying a new category, the is_new of the new category is forced to be set to 1.

When displaying the list and querying classified data, add the is_new = 1 condition. Just don’t add any conditions for is_new when searching.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template