Home  >  Article  >  CMS Tutorial  >  How dede adds the field father to dede_sys_enum

How dede adds the field father to dede_sys_enum

藏色散人
藏色散人Original
2019-12-19 10:00:282457browse

How dede adds the field father to dede_sys_enum

dedeHow to add the field father to dede_sys_enum?

dede provides a linkage model, corresponding to the database table dede_sys_enum, add A parent node field. Provide automatic update of triggers. There is an example below. You can refer to it.

Recommended learning: 梦Weavercms

Things:

dede provides Linkage model, corresponding to the database table dede_sys_enum, adds a parent node field. Provides automatic update of triggers.

Solution:

The trigger modifies the value of the father field

The code is as follows:

DELIMITER $$ 
CREATE TRIGGER `dede_sys_enum_AINS` 
BEFORE INSERT ON dede_sys_enum 
FOR EACH ROW 
BEGIN 
SET new.father=REPLACE(new.evalue,new.evalue,FLOOR(new.evalue/500)*500); 
end

The above is the detailed content of How dede adds the field father to dede_sys_enum. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn