Commit 86d7d29b authored by xierz's avatar xierz

Merge remote-tracking branch 'origin/5.2' into 5.2

parents 68cce8c4 4748d53a
...@@ -8,6 +8,31 @@ ALTER TABLE `cms_category` ADD COLUMN `leaf` bigint(1) NULL DEFAULT NULL COMMEN ...@@ -8,6 +8,31 @@ ALTER TABLE `cms_category` ADD COLUMN `leaf` bigint(1) NULL DEFAULT NULL COMMEN
ALTER TABLE `cms_category` ADD COLUMN `top_id` bigint(20) NULL DEFAULT NULL COMMENT '顶级id' AFTER `leaf`; ALTER TABLE `cms_category` ADD COLUMN `top_id` bigint(20) NULL DEFAULT NULL COMMENT '顶级id' AFTER `leaf`;
ALTER TABLE `cms_category` MODIFY COLUMN `id` bigint(20) UNSIGNED NOT NULL FIRST ; ALTER TABLE `cms_category` MODIFY COLUMN `id` bigint(20) UNSIGNED NOT NULL FIRST ;
ALTER TABLE `cms_content` MODIFY COLUMN `id` bigint(20) UNSIGNED NOT NULL FIRST ; ALTER TABLE `cms_content` MODIFY COLUMN `id` bigint(20) UNSIGNED NOT NULL FIRST ;
ALTER TABLE `manager` ADD COLUMN `create_date` datetime NULL DEFAULT NULL AFTER `manager_admin`;
ALTER TABLE `manager` ADD COLUMN `update_date` datetime NULL DEFAULT NULL AFTER `create_date`;
ALTER TABLE `manager` ADD COLUMN `update_by` int(11) NULL DEFAULT NULL AFTER `update_date`;
ALTER TABLE `manager` ADD COLUMN `create_by` int(11) NULL DEFAULT NULL AFTER `update_by`;
ALTER TABLE `manager` ADD COLUMN `del` int(11) NULL DEFAULT NULL AFTER `create_by`;
ALTER TABLE `manager` MODIFY COLUMN `manager_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '管理员id(主键)' FIRST ;
ALTER TABLE `mdiy_dict` ADD COLUMN `dict_enable` varchar(11) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT '1' COMMENT '启用状态' AFTER `is_child`;
ALTER TABLE `mdiy_model` ADD COLUMN `app_id` int(11) NULL DEFAULT NULL COMMENT '应用编号' AFTER `model_json`;
ALTER TABLE `mdiy_model` DROP COLUMN `model_app_id`;
ALTER TABLE `mdiy_page` DROP FOREIGN KEY `mdiy_page_ibfk_1`;
ALTER TABLE `mdiy_page` ADD COLUMN `app_id` int(11) NOT NULL COMMENT '应用id' AFTER `page_id`;
ALTER TABLE `mdiy_page` DROP COLUMN `page_app_id`;
ALTER TABLE `mdiy_page` ADD CONSTRAINT `mdiy_page_ibfk_1` FOREIGN KEY (`app_id`) REFERENCES `app` (`id`) ON DELETE CASCADE ON UPDATE RESTRICT;
DROP INDEX `index_page_app_id` ON `mdiy_page`;
CREATE INDEX `index_page_app_id` ON `mdiy_page`(`app_id`) USING BTREE ;
ALTER TABLE `people` DROP FOREIGN KEY `people_ibfk_1`;
ALTER TABLE `people` ADD COLUMN `app_id` int(11) NOT NULL COMMENT '应用编号' AFTER `people_datetime`;
ALTER TABLE `people` DROP COLUMN `people_app_id`;
ALTER TABLE `people` ADD CONSTRAINT `people_ibfk_1` FOREIGN KEY (`app_id`) REFERENCES `app` (`id`) ON DELETE CASCADE ON UPDATE NO ACTION;
DROP INDEX `fk_people` ON `people`;
CREATE INDEX `fk_people` ON `people`(`app_id`) USING BTREE ;
ALTER TABLE `people_address` ADD COLUMN `APP_ID` int(11) NOT NULL COMMENT '对应的站点id' AFTER `PA_DEFAULT`;
ALTER TABLE `people_address` DROP COLUMN `PA_APP_ID`;
DROP INDEX `PA_APP_ID` ON `people_address`;
CREATE INDEX `PA_APP_ID` ON `people_address`(`APP_ID`) USING BTREE ;
ALTER TABLE `system_log` MODIFY COLUMN `id` bigint(20) UNSIGNED NOT NULL FIRST ; ALTER TABLE `system_log` MODIFY COLUMN `id` bigint(20) UNSIGNED NOT NULL FIRST ;
UPDATE `mdiy_tag_sql` SET `id`='5', `tag_id`='3', `tag_sql`='<#assign _typeid=\'\'/>\r\n<#assign _size=\'20\'/>\r\n<#if column?? && column.id?? && column.id?number gt 0>\r\n <#assign _typeid=\'${column.id}\'>\r\n</#if>\r\n<#if typeid??>\r\n <#assign _typeid=\'${typeid}\'>\r\n</#if>\r\n<#if size??>\r\n <#assign _size=\'${size}\'>\r\n</#if>\r\n<#if orderby?? >\r\n <#if orderby==\'date\'> \r\n <#assign _orderby=\'content_datetime\'>\r\n <#elseif orderby==\'updatedate\'>\r\n <#assign _orderby=\'content_updatetime\'>\r\n <#elseif orderby==\'hit\'> \r\n <#assign _orderby=\'content_hit\'>\r\n <#elseif orderby==\'sort\'>\r\n <#assign _orderby=\'content_sort\'>\r\n <#else><#assign _orderby=\'cms_content.id\'></#if>\r\n <#else>\r\n <#assign _orderby=\'cms_content.id\'>\r\n </#if>\r\nSELECT\r\n cms_content.id AS id,\r\n content_title AS title,\r\n content_title AS fulltitle,\r\n content_author AS author,\r\n content_source AS source,\r\n content_details AS content,\r\n category.category_title AS typename,\r\n category.id AS typeid,\r\n category.category_img AS typelitpic,\r\n <#--列表页动态链接-->\r\n <#if isDo?? && isDo>\r\n CONCAT(\'/${modelName}/list.do?typeid=\', category.category_id) as typelink,\r\n <#else>\r\n (SELECT \'index.html\') AS typelink,\r\n </#if>\r\n content_img AS litpic,\r\n <#--内容页动态链接-->\r\n <#if isDo?? && isDo>\r\n CONCAT(\'/${modelName}/view.do?id=\', cms_content.id,\'&orderby=${_orderby}\',\'&order=${order!\'ASC\'}\',\'&typeid=${typeid}\') as \"link\",\r\n <#else>\r\n\r\n CONCAT(category.category_path,\'/\',cms_content.id,\'.html\') AS \"link\",\r\n </#if>\r\n content_datetime AS \"date\",<#if tableName??>${tableName}.*,</#if>\r\n content_description AS descrip,\r\n content_hit AS hit,\r\n content_type AS flag,\r\n category_title AS typetitle,\r\n cms_content.content_keyword AS keyword \r\nFROM\r\n cms_content\r\n LEFT JOIN cms_category as category ON content_category_id = category.id\r\n <#--判断是否有自定义模型表-->\r\n <#if tableName??>LEFT JOIN ${tableName} ON ${tableName}.link_id=cms_content.id </#if>\r\nWHERE \r\n content_display=0 \r\n and cms_content.del=0 \r\n <#--根据站点编号查询-->\r\n <#if appId?? >\r\n and cms_content.app_id=${appId}\r\n and cms_content.id>0\r\n </#if>\r\n <#--判断是否有搜索分类集合-->\r\n <#if search??>\r\n <#if search.categoryIds??>and FIND_IN_SET(category.id,\'${search.categoryIds}\')</#if>\r\n <#--标题-->\r\n <#if search.content_title??> and content_title like CONCAT(\'%\',\'${search.content_title}\',\'%\')</#if>\r\n <#--作者-->\r\n <#if search.content_author??> and content_author like CONCAT(\'%\',\'${search.content_author}\',\'%\')</#if>\r\n <#--来源-->\r\n <#if search.content_source??> and content_source like CONCAT(\'%\',\'${search.content_source}\',\'%\')</#if>\r\n <#--属性-->\r\n <#if search.content_type??> and (\r\n <#list search.content_type?split(\',\') as item>\r\n <#if item?index gt 0> or</#if>\r\n FIND_IN_SET(\'${item}\',cms_content.content_type)\r\n </#list>)</#if>\r\n <#--描述-->\r\n <#if search.content_description??> and content_description like CONCAT(\'%\',\'${search.content_description}\',\'%\')</#if>\r\n <#--关键字-->\r\n <#if search.content_keyword??> and content_keyword like CONCAT(\'%\',\'${search.content_keyword}\',\'%\')</#if>\r\n <#--内容-->\r\n <#if search.content_details??> and content_details like CONCAT(\'%\',\'${search.content_details}\',\'%\')</#if>\r\n \r\n<#--自定义顺序-->\r\n <#if search.content_sort??> and content_sort=${search.content_sort}</#if> \r\n<#--时间范围-->\r\n <#if search.content_datetime_start??&&search.content_datetime_end??> and content_datetime between \'${search.content_datetime_start}\' and \'${search.content_datetime_end}\'</#if>\r\n <#else><#--查询栏目-->\r\n <#if _typeid?has_content> and (content_category_id=${_typeid} or content_category_id in \r\n (select id FROM cms_category where cms_category.del=0 and FIND_IN_SET(${_typeid},CATEGORY_PARENT_ID))) </#if>\r\n </#if>\r\n <#--标题-->\r\n <#if content_title??> and content_title like CONCAT(\'%\',\'${content_title}\',\'%\')</#if>\r\n <#--作者-->\r\n <#if content_author??> and content_author like CONCAT(\'%\',\'${content_author}\',\'%\')</#if>\r\n <#--来源-->\r\n <#if content_source??> and content_source like CONCAT(\'%\',\'${content_source}\',\'%\')</#if>\r\n <#--属性-->\r\n <#if content_type??> and content_type like CONCAT(\'%\',\'${content_type}\',\'%\')</#if>\r\n <#--描述-->\r\n <#if content_description??> and content_description like CONCAT(\'%\',\'${content_description}\',\'%\')</#if>\r\n <#--关键字-->\r\n <#if content_keyword??> and content_keyword like CONCAT(\'%\',\'${content_keyword}\',\'%\')</#if>\r\n <#--内容-->\r\n <#if content_details??> and content_details like CONCAT(\'%\',\'${content_details}\',\'%\')</#if>\r\n <#--自定义顺序-->\r\n <#if content_sort??> and content_sort=${content_sort}</#if>\r\n <#--自定义模型-->\r\n <#if diyModel??> \r\n <#list diyModel as dm>\r\n and ${tableName}.${dm.key} like CONCAT(\'%\',\'${dm.value}\',\'%\') \r\n </#list>\r\n </#if>\r\n <#--文章属性-->\r\n <#if flag?? >\r\n and(\r\n <#list flag?split(\',\') as item>\r\n <#if item?index gt 0> or</#if>\r\n FIND_IN_SET(\'${item}\',cms_content.content_type)\r\n </#list>)\r\n </#if>\r\n <#if noflag??>\r\n and(\r\n <#list noflag?split(\',\') as item>\r\n <#if item?index gt 0> and</#if>\r\n FIND_IN_SET(\'${item}\',cms_content.content_type)=0\r\n </#list> or cms_content.content_type is null)\r\n </#if>\r\n <#--字段排序-->\r\n <#if orderby?? >\r\n ORDER BY \r\n <#if orderby==\'date\'> content_datetime\r\n <#elseif orderby==\'updatedate\'> content_updatetime\r\n <#elseif orderby==\'hit\'> content_hit\r\n <#elseif orderby==\'sort\'> content_sort\r\n <#else>cms_content.id</#if>\r\n <#else>\r\n ORDER BY cms_content.id\r\n </#if>\r\n <#if order?? >\r\n <#if order==\'desc\'> desc</#if>\r\n <#if order==\'asc\'> asc</#if>\r\n </#if>\r\n LIMIT \r\n <#--判断是否分页-->\r\n <#if ispaging?? && (pageTag.pageNo)??>${((pageTag.pageNo-1)*_size?eval)?c},${_size?default(20)}\r\n <#else>${_size?default(20)}</#if>', `sort`='1' WHERE (`id`='5'); UPDATE `mdiy_tag_sql` SET `id`='5', `tag_id`='3', `tag_sql`='<#assign _typeid=\'\'/>\r\n<#assign _size=\'20\'/>\r\n<#if column?? && column.id?? && column.id?number gt 0>\r\n <#assign _typeid=\'${column.id}\'>\r\n</#if>\r\n<#if typeid??>\r\n <#assign _typeid=\'${typeid}\'>\r\n</#if>\r\n<#if size??>\r\n <#assign _size=\'${size}\'>\r\n</#if>\r\n<#if orderby?? >\r\n <#if orderby==\'date\'> \r\n <#assign _orderby=\'content_datetime\'>\r\n <#elseif orderby==\'updatedate\'>\r\n <#assign _orderby=\'content_updatetime\'>\r\n <#elseif orderby==\'hit\'> \r\n <#assign _orderby=\'content_hit\'>\r\n <#elseif orderby==\'sort\'>\r\n <#assign _orderby=\'content_sort\'>\r\n <#else><#assign _orderby=\'cms_content.id\'></#if>\r\n <#else>\r\n <#assign _orderby=\'cms_content.id\'>\r\n </#if>\r\nSELECT\r\n cms_content.id AS id,\r\n content_title AS title,\r\n content_title AS fulltitle,\r\n content_author AS author,\r\n content_source AS source,\r\n content_details AS content,\r\n category.category_title AS typename,\r\n category.id AS typeid,\r\n category.category_img AS typelitpic,\r\n <#--列表页动态链接-->\r\n <#if isDo?? && isDo>\r\n CONCAT(\'/${modelName}/list.do?typeid=\', category.category_id) as typelink,\r\n <#else>\r\n (SELECT \'index.html\') AS typelink,\r\n </#if>\r\n content_img AS litpic,\r\n <#--内容页动态链接-->\r\n <#if isDo?? && isDo>\r\n CONCAT(\'/${modelName}/view.do?id=\', cms_content.id,\'&orderby=${_orderby}\',\'&order=${order!\'ASC\'}\',\'&typeid=${typeid}\') as \"link\",\r\n <#else>\r\n\r\n CONCAT(category.category_path,\'/\',cms_content.id,\'.html\') AS \"link\",\r\n </#if>\r\n content_datetime AS \"date\",<#if tableName??>${tableName}.*,</#if>\r\n content_description AS descrip,\r\n content_hit AS hit,\r\n content_type AS flag,\r\n category_title AS typetitle,\r\n cms_content.content_keyword AS keyword \r\nFROM\r\n cms_content\r\n LEFT JOIN cms_category as category ON content_category_id = category.id\r\n <#--判断是否有自定义模型表-->\r\n <#if tableName??>LEFT JOIN ${tableName} ON ${tableName}.link_id=cms_content.id </#if>\r\nWHERE \r\n content_display=0 \r\n and cms_content.del=0 \r\n <#--根据站点编号查询-->\r\n <#if appId?? >\r\n and cms_content.app_id=${appId}\r\n and cms_content.id>0\r\n </#if>\r\n <#--判断是否有搜索分类集合-->\r\n <#if search??>\r\n <#if search.categoryIds??>and FIND_IN_SET(category.id,\'${search.categoryIds}\')</#if>\r\n <#--标题-->\r\n <#if search.content_title??> and content_title like CONCAT(\'%\',\'${search.content_title}\',\'%\')</#if>\r\n <#--作者-->\r\n <#if search.content_author??> and content_author like CONCAT(\'%\',\'${search.content_author}\',\'%\')</#if>\r\n <#--来源-->\r\n <#if search.content_source??> and content_source like CONCAT(\'%\',\'${search.content_source}\',\'%\')</#if>\r\n <#--属性-->\r\n <#if search.content_type??> and (\r\n <#list search.content_type?split(\',\') as item>\r\n <#if item?index gt 0> or</#if>\r\n FIND_IN_SET(\'${item}\',cms_content.content_type)\r\n </#list>)</#if>\r\n <#--描述-->\r\n <#if search.content_description??> and content_description like CONCAT(\'%\',\'${search.content_description}\',\'%\')</#if>\r\n <#--关键字-->\r\n <#if search.content_keyword??> and content_keyword like CONCAT(\'%\',\'${search.content_keyword}\',\'%\')</#if>\r\n <#--内容-->\r\n <#if search.content_details??> and content_details like CONCAT(\'%\',\'${search.content_details}\',\'%\')</#if>\r\n \r\n<#--自定义顺序-->\r\n <#if search.content_sort??> and content_sort=${search.content_sort}</#if> \r\n<#--时间范围-->\r\n <#if search.content_datetime_start??&&search.content_datetime_end??> and content_datetime between \'${search.content_datetime_start}\' and \'${search.content_datetime_end}\'</#if>\r\n <#else><#--查询栏目-->\r\n <#if _typeid?has_content> and (content_category_id=${_typeid} or content_category_id in \r\n (select id FROM cms_category where cms_category.del=0 and FIND_IN_SET(${_typeid},CATEGORY_PARENT_ID))) </#if>\r\n </#if>\r\n <#--标题-->\r\n <#if content_title??> and content_title like CONCAT(\'%\',\'${content_title}\',\'%\')</#if>\r\n <#--作者-->\r\n <#if content_author??> and content_author like CONCAT(\'%\',\'${content_author}\',\'%\')</#if>\r\n <#--来源-->\r\n <#if content_source??> and content_source like CONCAT(\'%\',\'${content_source}\',\'%\')</#if>\r\n <#--属性-->\r\n <#if content_type??> and content_type like CONCAT(\'%\',\'${content_type}\',\'%\')</#if>\r\n <#--描述-->\r\n <#if content_description??> and content_description like CONCAT(\'%\',\'${content_description}\',\'%\')</#if>\r\n <#--关键字-->\r\n <#if content_keyword??> and content_keyword like CONCAT(\'%\',\'${content_keyword}\',\'%\')</#if>\r\n <#--内容-->\r\n <#if content_details??> and content_details like CONCAT(\'%\',\'${content_details}\',\'%\')</#if>\r\n <#--自定义顺序-->\r\n <#if content_sort??> and content_sort=${content_sort}</#if>\r\n <#--自定义模型-->\r\n <#if diyModel??> \r\n <#list diyModel as dm>\r\n and ${tableName}.${dm.key} like CONCAT(\'%\',\'${dm.value}\',\'%\') \r\n </#list>\r\n </#if>\r\n <#--文章属性-->\r\n <#if flag?? >\r\n and(\r\n <#list flag?split(\',\') as item>\r\n <#if item?index gt 0> or</#if>\r\n FIND_IN_SET(\'${item}\',cms_content.content_type)\r\n </#list>)\r\n </#if>\r\n <#if noflag??>\r\n and(\r\n <#list noflag?split(\',\') as item>\r\n <#if item?index gt 0> and</#if>\r\n FIND_IN_SET(\'${item}\',cms_content.content_type)=0\r\n </#list> or cms_content.content_type is null)\r\n </#if>\r\n <#--字段排序-->\r\n <#if orderby?? >\r\n ORDER BY \r\n <#if orderby==\'date\'> content_datetime\r\n <#elseif orderby==\'updatedate\'> content_updatetime\r\n <#elseif orderby==\'hit\'> content_hit\r\n <#elseif orderby==\'sort\'> content_sort\r\n <#else>cms_content.id</#if>\r\n <#else>\r\n ORDER BY cms_content.id\r\n </#if>\r\n <#if order?? >\r\n <#if order==\'desc\'> desc</#if>\r\n <#if order==\'asc\'> asc</#if>\r\n </#if>\r\n LIMIT \r\n <#--判断是否分页-->\r\n <#if ispaging?? && (pageTag.pageNo)??>${((pageTag.pageNo-1)*_size?eval)?c},${_size?default(20)}\r\n <#else>${_size?default(20)}</#if>', `sort`='1' WHERE (`id`='5');
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment