!160 上下篇的判断修改

Merge pull request !160 from 他是超人他会飞/4.7.0
This commit is contained in:
他是超人他会飞 2019-03-19 14:08:31 +08:00 committed by 铭飞
commit 59bdeabbc3
4 changed files with 11 additions and 7 deletions

View File

@ -66,9 +66,9 @@ INSERT INTO `mdiy_tag_sql` VALUES ('5', '3', '<#assign _typeid=\"\"/>\r\n<#if co
INSERT INTO `mdiy_tag_sql` VALUES ('6', '4', '<#assign _typeid=\"\"/>\r\n<#if column?? && column.categoryId??>\r\n <#assign _typeid=\"${column.categoryId}\">\r\n</#if>\r\n<#if typeid??>\r\n <#assign _typeid=\"${typeid}\">\r\n</#if>\r\nselect \r\n @rownum := @rownum + 1 AS typeindex,\r\n category_id as id,\r\n category_id as typeid,\r\n category_title as typetitle,\r\n <#--返回父id集合-->\r\n category_parent_id as pids,\r\n <#--栏目选中的样式-->\r\n IF(<#if _typeid?has_content>${_typeid}<#else>0</#if> = category_id ,\"${class!\'\'}\",\"\") as class,\r\n <#--动态链接-->\r\n <#if isDo?? && isDo>\r\n CONCAT(\"/${modelName}/list.do?typeid=\", category_id) as typelink,\r\n <#else>\r\n CONCAT(column_path,\"/index.html\") as typelink,\r\n </#if>\r\n column_keyword as typekeyword,\r\n column_descrip as typedescrip,\r\n category_smallimg as typelitpic \r\n from (SELECT @rownum := 0) r,category \r\n LEFT JOIN basic_column bc on bc.column_category_id=category.category_id where \r\n category.del=0 \r\n <#--根据模块编号查询分类-->\r\n <#if column?? && column.categoryModelId?has_content>\r\n and category_modelid=${column.categoryModelId}\r\n </#if>\r\n<#if type?has_content>\r\n <#--顶级栏目(单个)-->\r\n <#if type==\"top\">\r\n and category_id=(select left(category_parent_id,LOCATE(\",\",category_parent_id)-1) from category where category_id = ${_typeid})\r\n <#elseif type==\"nav\">\r\n and(category_categoryid=0 or category_categoryid is null)\r\n <#--同级栏目(多个)-->\r\n <#elseif type==\"level\">\r\n and\r\n <#if _typeid?has_content>\r\n category_categoryid=(select category_categoryid from category where category_id=${_typeid})\r\n <#else>\r\n 1=1\r\n </#if>\r\n <#--当前栏目(单个)-->\r\n <#elseif type==\"self\">\r\n and \r\n <#if _typeid?has_content>\r\n category_id=${_typeid}\r\n <#else>\r\n 1=1\r\n </#if>\r\n <#--当前栏目的所属栏目(多个)-->\r\n <#elseif type==\"path\">\r\n and \r\n <#if _typeid?has_content>\r\n category_id in (<#if column?? && column.categoryParentId??>${column.categoryParentId},</#if>${_typeid})\r\n <#else>\r\n 1=1\r\n </#if>\r\n <#--子栏目(多个)-->\r\n <#elseif type==\"son\">\r\n and \r\n <#if _typeid?has_content>\r\n category_categoryid=${_typeid}\r\n <#else>\r\n 1=1\r\n </#if>\r\n <#--上一级栏目没有则取当前栏目(单个)-->\r\n <#elseif type==\"parent\">\r\n and \r\n <#if _typeid?has_content>\r\n <#if column?? && column.categoryCategoryId?? && column.categoryCategoryId!=0>\r\n category_id=${column.categoryCategoryId}\r\n <#else>\r\n category_id=${_typeid}\r\n </#if>\r\n <#else>\r\n 1=1\r\n </#if>\r\n <#--子栏目或同级栏目(多个)-->\r\n <#elseif type==\"sonOrLevel\">\r\n and \r\n <#if _typeid?has_content>\r\n category_categoryid= if((SELECT count(*) FROM category\r\n LEFT JOIN basic_column bc ON bc.column_category_id = category.category_id \r\n WHERE category_categoryid=${_typeid})>0,${_typeid},(select category_categoryid from category where category_id=${_typeid}))\r\n <#else>\r\n 1=1\r\n </#if>\r\n </#if>\r\n<#else> <#--默认son-->\r\n and\r\n <#if _typeid?has_content>\r\n category_categoryid=${_typeid}\r\n <#else>\r\n (category_categoryid=0 or category_categoryid is null)\r\n </#if>\r\n</#if>', '1'); INSERT INTO `mdiy_tag_sql` VALUES ('6', '4', '<#assign _typeid=\"\"/>\r\n<#if column?? && column.categoryId??>\r\n <#assign _typeid=\"${column.categoryId}\">\r\n</#if>\r\n<#if typeid??>\r\n <#assign _typeid=\"${typeid}\">\r\n</#if>\r\nselect \r\n @rownum := @rownum + 1 AS typeindex,\r\n category_id as id,\r\n category_id as typeid,\r\n category_title as typetitle,\r\n <#--返回父id集合-->\r\n category_parent_id as pids,\r\n <#--栏目选中的样式-->\r\n IF(<#if _typeid?has_content>${_typeid}<#else>0</#if> = category_id ,\"${class!\'\'}\",\"\") as class,\r\n <#--动态链接-->\r\n <#if isDo?? && isDo>\r\n CONCAT(\"/${modelName}/list.do?typeid=\", category_id) as typelink,\r\n <#else>\r\n CONCAT(column_path,\"/index.html\") as typelink,\r\n </#if>\r\n column_keyword as typekeyword,\r\n column_descrip as typedescrip,\r\n category_smallimg as typelitpic \r\n from (SELECT @rownum := 0) r,category \r\n LEFT JOIN basic_column bc on bc.column_category_id=category.category_id where \r\n category.del=0 \r\n <#--根据模块编号查询分类-->\r\n <#if column?? && column.categoryModelId?has_content>\r\n and category_modelid=${column.categoryModelId}\r\n </#if>\r\n<#if type?has_content>\r\n <#--顶级栏目(单个)-->\r\n <#if type==\"top\">\r\n and category_id=(select left(category_parent_id,LOCATE(\",\",category_parent_id)-1) from category where category_id = ${_typeid})\r\n <#elseif type==\"nav\">\r\n and(category_categoryid=0 or category_categoryid is null)\r\n <#--同级栏目(多个)-->\r\n <#elseif type==\"level\">\r\n and\r\n <#if _typeid?has_content>\r\n category_categoryid=(select category_categoryid from category where category_id=${_typeid})\r\n <#else>\r\n 1=1\r\n </#if>\r\n <#--当前栏目(单个)-->\r\n <#elseif type==\"self\">\r\n and \r\n <#if _typeid?has_content>\r\n category_id=${_typeid}\r\n <#else>\r\n 1=1\r\n </#if>\r\n <#--当前栏目的所属栏目(多个)-->\r\n <#elseif type==\"path\">\r\n and \r\n <#if _typeid?has_content>\r\n category_id in (<#if column?? && column.categoryParentId??>${column.categoryParentId},</#if>${_typeid})\r\n <#else>\r\n 1=1\r\n </#if>\r\n <#--子栏目(多个)-->\r\n <#elseif type==\"son\">\r\n and \r\n <#if _typeid?has_content>\r\n category_categoryid=${_typeid}\r\n <#else>\r\n 1=1\r\n </#if>\r\n <#--上一级栏目没有则取当前栏目(单个)-->\r\n <#elseif type==\"parent\">\r\n and \r\n <#if _typeid?has_content>\r\n <#if column?? && column.categoryCategoryId?? && column.categoryCategoryId!=0>\r\n category_id=${column.categoryCategoryId}\r\n <#else>\r\n category_id=${_typeid}\r\n </#if>\r\n <#else>\r\n 1=1\r\n </#if>\r\n <#--子栏目或同级栏目(多个)-->\r\n <#elseif type==\"sonOrLevel\">\r\n and \r\n <#if _typeid?has_content>\r\n category_categoryid= if((SELECT count(*) FROM category\r\n LEFT JOIN basic_column bc ON bc.column_category_id = category.category_id \r\n WHERE category_categoryid=${_typeid})>0,${_typeid},(select category_categoryid from category where category_id=${_typeid}))\r\n <#else>\r\n 1=1\r\n </#if>\r\n </#if>\r\n<#else> <#--默认son-->\r\n and\r\n <#if _typeid?has_content>\r\n category_categoryid=${_typeid}\r\n <#else>\r\n (category_categoryid=0 or category_categoryid is null)\r\n </#if>\r\n</#if>', '1');
INSERT INTO `mdiy_tag_sql` VALUES ('7', '5', 'select \r\nAPP_NAME as name,\r\napp_logo as logo,\r\napp_keyword as keyword,\r\napp_description as descrip,\r\napp_copyright as copyright,\r\n<#--动态解析 -->\r\n<#if isDo?? && isDo>\r\n\"${url}\" as url,\r\n\"${url}\" as host,\r\n<#--使用地址栏的域名 -->\r\n<#elseif url??>\r\nCONCAT(\"${url}\",\"/${html}/\",app_id,\"/<#if m??>${m}</#if>\") as url,\r\n\"${url}\" as host,\r\n<#else>\r\nCONCAT(REPLACE(REPLACE(TRIM(substring_index(app_url,\"\\n\",1)), CHAR(10),\'\'), CHAR(13),\'\'),\"/html/\",app_id,\"/<#if m??>${m}</#if>\") as url,\r\nREPLACE(REPLACE(TRIM(substring_index(app_url,\"\\n\",1)), CHAR(10),\'\'), CHAR(13),\'\') as host,\r\n</#if>\r\nCONCAT(\"templets/\",app_id,\"/\",<#if m??>CONCAT(app_style,\"/${m}\")<#else>app_style</#if>) as style <#-- 判断是否为手机端 -->\r\nfrom app limit 1', '1'); INSERT INTO `mdiy_tag_sql` VALUES ('7', '5', 'select \r\nAPP_NAME as name,\r\napp_logo as logo,\r\napp_keyword as keyword,\r\napp_description as descrip,\r\napp_copyright as copyright,\r\n<#--动态解析 -->\r\n<#if isDo?? && isDo>\r\n\"${url}\" as url,\r\n\"${url}\" as host,\r\n<#--使用地址栏的域名 -->\r\n<#elseif url??>\r\nCONCAT(\"${url}\",\"/${html}/\",app_id,\"/<#if m??>${m}</#if>\") as url,\r\n\"${url}\" as host,\r\n<#else>\r\nCONCAT(REPLACE(REPLACE(TRIM(substring_index(app_url,\"\\n\",1)), CHAR(10),\'\'), CHAR(13),\'\'),\"/html/\",app_id,\"/<#if m??>${m}</#if>\") as url,\r\nREPLACE(REPLACE(TRIM(substring_index(app_url,\"\\n\",1)), CHAR(10),\'\'), CHAR(13),\'\') as host,\r\n</#if>\r\nCONCAT(\"templets/\",app_id,\"/\",<#if m??>CONCAT(app_style,\"/${m}\")<#else>app_style</#if>) as style <#-- 判断是否为手机端 -->\r\nfrom app limit 1', '1');
INSERT INTO `mdiy_tag_sql` VALUES ('8', '7', 'SELECT \r\nbasic_id as id,\r\nleft(basic_title,${titlelen?default(40)}) as title,\r\nbasic_title as fulltitle,\r\narticle_author as author, \r\narticle_source as source, \r\narticle_content as content,\r\ncategory.category_title as typetitle,\r\ncategory.category_id as typeid,\r\ncategory.category_smallimg AS typelitpic,\r\n<#--动态链接-->\r\n<#if isDo?? && isDo>\r\nCONCAT(\"/${modelName}/list.do?typeid=\", category.category_id) as typelink,\r\n<#else>\r\n(SELECT \"index.html\") as typelink,\r\n</#if>\r\nbasic.basic_thumbnails as litpic,\r\n<#--内容页动态链接-->\r\n<#if isDo?? && isDo>\r\nCONCAT(\"/mcms/view.do?id=\", basic_id) as link,\r\n<#else>\r\ncms_article.article_url AS link,\r\n</#if>\r\nbasic_datetime as date,\r\nbasic_description as descrip,\r\nCONCAT(\"<script type=\'text/javascript\' src=\'${url}/basic/\",basic_id,\"/hit.do\'></script>\") as hit,\r\narticle_type as flag,\r\ncategory_title as typetitle,\r\n<#if tableName??>${tableName}.*,</#if>\r\ncms_article.article_keyword as keyword\r\nFROM basic LEFT JOIN cms_article ON cms_article.article_basicid = basic.basic_id \r\nLEFT JOIN category ON basic_categoryid=category.category_id \r\nLEFT JOIN basic_column ON basic_column.column_category_id=basic.basic_categoryid\r\n<#--判断是否有自定义模型表-->\r\n<#if tableName??>left join ${tableName} on ${tableName}.basicId=cms_article.ARTICLE_BASICID</#if>\r\nWHERE \r\n1=1\r\n<#if id??> and basic_id=${id}</#if>', '1'); INSERT INTO `mdiy_tag_sql` VALUES ('8', '7', 'SELECT \r\nbasic_id as id,\r\nleft(basic_title,${titlelen?default(40)}) as title,\r\nbasic_title as fulltitle,\r\narticle_author as author, \r\narticle_source as source, \r\narticle_content as content,\r\ncategory.category_title as typetitle,\r\ncategory.category_id as typeid,\r\ncategory.category_smallimg AS typelitpic,\r\n<#--动态链接-->\r\n<#if isDo?? && isDo>\r\nCONCAT(\"/${modelName}/list.do?typeid=\", category.category_id) as typelink,\r\n<#else>\r\n(SELECT \"index.html\") as typelink,\r\n</#if>\r\nbasic.basic_thumbnails as litpic,\r\n<#--内容页动态链接-->\r\n<#if isDo?? && isDo>\r\nCONCAT(\"/mcms/view.do?id=\", basic_id) as link,\r\n<#else>\r\ncms_article.article_url AS link,\r\n</#if>\r\nbasic_datetime as date,\r\nbasic_description as descrip,\r\nCONCAT(\"<script type=\'text/javascript\' src=\'${url}/basic/\",basic_id,\"/hit.do\'></script>\") as hit,\r\narticle_type as flag,\r\ncategory_title as typetitle,\r\n<#if tableName??>${tableName}.*,</#if>\r\ncms_article.article_keyword as keyword\r\nFROM basic LEFT JOIN cms_article ON cms_article.article_basicid = basic.basic_id \r\nLEFT JOIN category ON basic_categoryid=category.category_id \r\nLEFT JOIN basic_column ON basic_column.column_category_id=basic.basic_categoryid\r\n<#--判断是否有自定义模型表-->\r\n<#if tableName??>left join ${tableName} on ${tableName}.basicId=cms_article.ARTICLE_BASICID</#if>\r\nWHERE \r\n1=1\r\n<#if id??> and basic_id=${id}</#if>', '1');
INSERT INTO `mdiy_tag_sql` VALUES ('9', '8', '<#assign select=\"(SELECT \'\')\"/>\r\n<#if (pageTag.preId)??>\r\nSELECT \r\nbasic_id as id,\r\nleft(basic_title,${titlelen?default(40)}) as title,\r\nbasic_title as fulltitle,\r\narticle_author as author, \r\narticle_source as source, \r\narticle_content as content,\r\ncategory.category_title as typename,\r\ncategory.category_id as typeid,\r\n(SELECT \"index.html\") AS typelink,\r\nbasic.basic_thumbnails as litpic,\r\ncms_article.article_url as link,\r\nbasic_datetime as date,\r\nbasic_description as descrip,\r\nbasic_hit as hit,\r\narticle_type as flag,\r\ncms_article.article_keyword as keyword \r\nFROM basic LEFT JOIN cms_article ON cms_article.article_basicid = basic.basic_id \r\nLEFT JOIN category ON basic_categoryid=category.category_id \r\nLEFT JOIN basic_column ON basic_column.column_category_id=basic.basic_categoryid \r\nWHERE basic_id=${pageTag.preId}\r\n<#else><#--没有上一页返回空字符串-->\r\nSELECT \r\n${select} as id,\r\n${select} as title,\r\n${select} as fulltitle,\r\n${select} as author, \r\n${select} as source, \r\n${select} as content,\r\n${select} as typename,\r\n${select} as typeid,\r\n${select} as typelink,\r\n${select} as litpic,\r\n${select} as link,\r\n${select} as date,\r\n${select} as descrip,\r\n${select} as hit,\r\n${select} as flag,\r\n${select} as keyword FROM basic\r\n</#if>', null); INSERT INTO `mdiy_tag_sql` VALUES ('9', '8', '<#assign select=\"(SELECT \'\')\"/>\r\n<#if (pageTag.preId)gt 0>\r\nSELECT \r\nbasic_id as id,\r\nleft(basic_title,${titlelen?default(40)}) as title,\r\nbasic_title as fulltitle,\r\narticle_author as author, \r\narticle_source as source, \r\narticle_content as content,\r\ncategory.category_title as typename,\r\ncategory.category_id as typeid,\r\n(SELECT \"index.html\") AS typelink,\r\nbasic.basic_thumbnails as litpic,\r\ncms_article.article_url as link,\r\nbasic_datetime as date,\r\nbasic_description as descrip,\r\nbasic_hit as hit,\r\narticle_type as flag,\r\ncms_article.article_keyword as keyword \r\nFROM basic LEFT JOIN cms_article ON cms_article.article_basicid = basic.basic_id \r\nLEFT JOIN category ON basic_categoryid=category.category_id \r\nLEFT JOIN basic_column ON basic_column.column_category_id=basic.basic_categoryid \r\nWHERE basic_id=${pageTag.preId}\r\n<#else><#--没有上一页返回空字符串-->\r\nSELECT \r\n${select} as id,\r\n${select} as title,\r\n${select} as fulltitle,\r\n${select} as author, \r\n${select} as source, \r\n${select} as content,\r\n${select} as typename,\r\n${select} as typeid,\r\n${select} as typelink,\r\n${select} as litpic,\r\n${select} as link,\r\n${select} as date,\r\n${select} as descrip,\r\n${select} as hit,\r\n${select} as flag,\r\n${select} as keyword FROM basic\r\n</#if>', null);
INSERT INTO `mdiy_tag_sql` VALUES ('10', '9', ' select\r\n <#if !(pageTag.indexUrl??)>\r\n <#--判断是否有栏目对象,用于搜索不传栏目-->\r\n <#if column??>\r\n <#--顶级栏目处理-->\r\n <#if column.categoryCategoryId==0>\r\n <#assign path=column.columnPath/>\r\n <#else>\r\n <#assign path=column.columnPath/>\r\n </#if>\r\n <#else>\r\n <#assign path=\"\"/>\r\n </#if>\r\n <#--总记录数、总页数-->\r\n (SELECT ${pageTag.total}) as total,\r\n <#--记录总数-->\r\n (SELECT ${pageTag.size}) as rcount,\r\n <#--当前页码-->\r\n (SELECT ${pageTag.pageNo}) as cur,\r\n <#--首页-->\r\n CONCAT(\"${path}\", \"/index.html\") as `index`,\r\n <#--上一页-->\r\n <#if (pageTag.pageNo?eval-1) gt 1>\r\n CONCAT(\"${path}\",\"/list-${pageTag.pageNo?eval-1}.html\") as pre,\r\n <#else>\r\n CONCAT(\"${path}\",\"/index.html\") as pre,\r\n </#if>\r\n <#--下一页-->\r\n <#if pageTag.total==1>\r\n CONCAT(\"${path}\", \"/index.html\") as `next`,\r\n CONCAT(\"${path}\", \"/index.html\") as `last`\r\n <#else>\r\n <#if pageTag.pageNo?eval gte pageTag.total>\r\n CONCAT(\"${path}\",\"/list-${pageTag.total}.html\") as next,\r\n <#else>\r\n CONCAT(\"${path}\",\"/list-${pageTag.pageNo?eval+1}.html\") as next,\r\n </#if>\r\n <#--最后一页-->\r\n CONCAT(\"${path}\",\"/list-${pageTag.total}.html\") as last\r\n </#if>\r\n<#else><#--判断是否是搜索页面-->\r\n \"${pageTag.indexUrl}\" as `index`,\"${pageTag.lastUrl}\" as `last`,\"${pageTag.preUrl}\" as `pre`,\"${pageTag.nextUrl}\" as `next`,\'${pageTag.total}\' as total,\'${pageTag.size}\' as rcount,\'${pageTag.pageNo}\' as cur\r\n</#if>', null); INSERT INTO `mdiy_tag_sql` VALUES ('10', '9', ' select\r\n <#if !(pageTag.indexUrl??)>\r\n <#--判断是否有栏目对象,用于搜索不传栏目-->\r\n <#if column??>\r\n <#--顶级栏目处理-->\r\n <#if column.categoryCategoryId==0>\r\n <#assign path=column.columnPath/>\r\n <#else>\r\n <#assign path=column.columnPath/>\r\n </#if>\r\n <#else>\r\n <#assign path=\"\"/>\r\n </#if>\r\n <#--总记录数、总页数-->\r\n (SELECT ${pageTag.total}) as total,\r\n <#--记录总数-->\r\n (SELECT ${pageTag.size}) as rcount,\r\n <#--当前页码-->\r\n (SELECT ${pageTag.pageNo}) as cur,\r\n <#--首页-->\r\n CONCAT(\"${path}\", \"/index.html\") as `index`,\r\n <#--上一页-->\r\n <#if (pageTag.pageNo?eval-1) gt 1>\r\n CONCAT(\"${path}\",\"/list-${pageTag.pageNo?eval-1}.html\") as pre,\r\n <#else>\r\n CONCAT(\"${path}\",\"/index.html\") as pre,\r\n </#if>\r\n <#--下一页-->\r\n <#if pageTag.total==1>\r\n CONCAT(\"${path}\", \"/index.html\") as `next`,\r\n CONCAT(\"${path}\", \"/index.html\") as `last`\r\n <#else>\r\n <#if pageTag.pageNo?eval gte pageTag.total>\r\n CONCAT(\"${path}\",\"/list-${pageTag.total}.html\") as next,\r\n <#else>\r\n CONCAT(\"${path}\",\"/list-${pageTag.pageNo?eval+1}.html\") as next,\r\n </#if>\r\n <#--最后一页-->\r\n CONCAT(\"${path}\",\"/list-${pageTag.total}.html\") as last\r\n </#if>\r\n<#else><#--判断是否是搜索页面-->\r\n \"${pageTag.indexUrl}\" as `index`,\"${pageTag.lastUrl}\" as `last`,\"${pageTag.preUrl}\" as `pre`,\"${pageTag.nextUrl}\" as `next`,\'${pageTag.total}\' as total,\'${pageTag.size}\' as rcount,\'${pageTag.pageNo}\' as cur\r\n</#if>', null);
INSERT INTO `mdiy_tag_sql` VALUES ('11', '10', '<#assign select=\"(SELECT \'\')\"/>\r\n<#if (pageTag.nextId)??>\r\nSELECT \r\nbasic_id as id,\r\nleft(basic_title,${titlelen?default(40)}) as title,\r\nbasic_title as fulltitle,\r\narticle_author as author, \r\narticle_source as source, \r\narticle_content as content,\r\ncategory.category_title as typename,\r\ncategory.category_id as typeid,\r\n(SELECT \"index.html\") as typelink,\r\nbasic.basic_thumbnails as litpic,\r\ncms_article.article_url as link,\r\nbasic_datetime as date,\r\nbasic_description as descrip,\r\nbasic_hit as hit,\r\narticle_type as flag,\r\ncms_article.article_keyword as keyword \r\nFROM basic LEFT JOIN cms_article ON cms_article.article_basicid = basic.basic_id \r\nLEFT JOIN category ON basic_categoryid=category.category_id \r\nLEFT JOIN basic_column ON basic_column.column_category_id=basic.basic_categoryid \r\nWHERE basic_id=${pageTag.nextId}\r\n<#else>\r\nSELECT \r\n${select} as id,\r\n${select} as title,\r\n${select} as fulltitle,\r\n${select} as author, \r\n${select} as source, \r\n${select} as content,\r\n${select} as typename,\r\n${select} as typeid,\r\n${select} as typelink,\r\n${select} as litpic,\r\n${select} as link,\r\n${select} as date,\r\n${select} as descrip,\r\n${select} as hit,\r\n${select} as flag,\r\n${select} as keyword FROM basic\r\n</#if>', null); INSERT INTO `mdiy_tag_sql` VALUES ('11', '10', '<#assign select=\"(SELECT \'\')\"/>\r\n<#if (pageTag.nextId)gt 0>\r\nSELECT \r\nbasic_id as id,\r\nleft(basic_title,${titlelen?default(40)}) as title,\r\nbasic_title as fulltitle,\r\narticle_author as author, \r\narticle_source as source, \r\narticle_content as content,\r\ncategory.category_title as typename,\r\ncategory.category_id as typeid,\r\n(SELECT \"index.html\") as typelink,\r\nbasic.basic_thumbnails as litpic,\r\ncms_article.article_url as link,\r\nbasic_datetime as date,\r\nbasic_description as descrip,\r\nbasic_hit as hit,\r\narticle_type as flag,\r\ncms_article.article_keyword as keyword \r\nFROM basic LEFT JOIN cms_article ON cms_article.article_basicid = basic.basic_id \r\nLEFT JOIN category ON basic_categoryid=category.category_id \r\nLEFT JOIN basic_column ON basic_column.column_category_id=basic.basic_categoryid \r\nWHERE basic_id=${pageTag.nextId}\r\n<#else>\r\nSELECT \r\n${select} as id,\r\n${select} as title,\r\n${select} as fulltitle,\r\n${select} as author, \r\n${select} as source, \r\n${select} as content,\r\n${select} as typename,\r\n${select} as typeid,\r\n${select} as typelink,\r\n${select} as litpic,\r\n${select} as link,\r\n${select} as date,\r\n${select} as descrip,\r\n${select} as hit,\r\n${select} as flag,\r\n${select} as keyword FROM basic\r\n</#if>', null);
INSERT INTO `mdiy_tag_sql` VALUES ('13', '12', 'SELECT\r\n basic_id AS id,\r\n product_price as price,\r\n product_cost_price AS costprice,\r\n product_content AS content,\r\n product_code AS code,\r\n <#--详情页动态链接-->\r\n <#if isDo?? && isDo>\r\n CONCAT(\"/${modelName}/view.do?id=\", basic_id) as link,\r\n <#else>\r\n product_linkUrl AS link,\r\n </#if>\r\n basic_title AS title,\r\n product_sale AS sale,\r\n product_good AS specification,\r\n product_inventory AS stock,\r\n basic.basic_categoryid AS typeid,\r\n basic_thumbnails AS litpic,\r\n <#--列表页动态链接-->\r\n <#if isDo?? && isDo>\r\n CONCAT(\"/mmall/list.do?typeid=\", category.category_id) as typelink,\r\n <#else>\r\n (SELECT \"index.html\") AS typelink,\r\n </#if>\r\n <#--判断是否有自定义模型表-->\r\n <#if tableNname??>${tableNname}.*,</#if>\r\n category_title AS typetitle\r\nFROM\r\n mall_product \r\n LEFT JOIN basic ON mall_product.product_basicID = basic.basic_id\r\n LEFT JOIN category ON basic_categoryid = category.category_id\r\n <#--判断是否有自定义模型表-->\r\n <#if tableNname??>LEFT JOIN ${tableNname} ON ${tableNname}.basicId=mall_product.product_basicID </#if>\r\nWHERE\r\n 1 = 1 <#--查询栏目-->\r\n <#if (typeid)??> and (basic_categoryid=${typeid} or basic_categoryid in \r\n (select category_id FROM category where find_in_set(${typeid},CATEGORY_PARENT_ID)))\r\n </#if>\r\n <#--模糊查询商品标题-->\r\n <#if basic_title??> and basic_title like CONCAT(\"%\",\'${basic_title}\',\"%\")</#if> \r\n LIMIT <#--判断是否分页-->\r\n <#if ispaging?? && pageNo??>${(pageNo?eval-1)*size?eval},${size?default(20)}\r\n <#else>${size?default(20)}</#if>', null); INSERT INTO `mdiy_tag_sql` VALUES ('13', '12', 'SELECT\r\n basic_id AS id,\r\n product_price as price,\r\n product_cost_price AS costprice,\r\n product_content AS content,\r\n product_code AS code,\r\n <#--详情页动态链接-->\r\n <#if isDo?? && isDo>\r\n CONCAT(\"/${modelName}/view.do?id=\", basic_id) as link,\r\n <#else>\r\n product_linkUrl AS link,\r\n </#if>\r\n basic_title AS title,\r\n product_sale AS sale,\r\n product_good AS specification,\r\n product_inventory AS stock,\r\n basic.basic_categoryid AS typeid,\r\n basic_thumbnails AS litpic,\r\n <#--列表页动态链接-->\r\n <#if isDo?? && isDo>\r\n CONCAT(\"/mmall/list.do?typeid=\", category.category_id) as typelink,\r\n <#else>\r\n (SELECT \"index.html\") AS typelink,\r\n </#if>\r\n <#--判断是否有自定义模型表-->\r\n <#if tableNname??>${tableNname}.*,</#if>\r\n category_title AS typetitle\r\nFROM\r\n mall_product \r\n LEFT JOIN basic ON mall_product.product_basicID = basic.basic_id\r\n LEFT JOIN category ON basic_categoryid = category.category_id\r\n <#--判断是否有自定义模型表-->\r\n <#if tableNname??>LEFT JOIN ${tableNname} ON ${tableNname}.basicId=mall_product.product_basicID </#if>\r\nWHERE\r\n 1 = 1 <#--查询栏目-->\r\n <#if (typeid)??> and (basic_categoryid=${typeid} or basic_categoryid in \r\n (select category_id FROM category where find_in_set(${typeid},CATEGORY_PARENT_ID)))\r\n </#if>\r\n <#--模糊查询商品标题-->\r\n <#if basic_title??> and basic_title like CONCAT(\"%\",\'${basic_title}\',\"%\")</#if> \r\n LIMIT <#--判断是否分页-->\r\n <#if ispaging?? && pageNo??>${(pageNo?eval-1)*size?eval},${size?default(20)}\r\n <#else>${size?default(20)}</#if>', null);
INSERT INTO `mdiy_tag_sql` VALUES ('14', '13', 'SELECT\r\n basic_id AS id,\r\n product_price as price,\r\n product_cost_price AS costprice,\r\n product_content AS content,\r\n product_code AS code,\r\n <#--详情页动态链接-->\r\n <#if isDo?? && isDo>\r\n CONCAT(\"/${modelName}/view.do?id=\", basic_id) as link,\r\n <#else>\r\n product_linkUrl AS link,\r\n </#if>\r\n basic_title AS title,\r\n product_sale AS sale,\r\n product_good AS specification,\r\n product_inventory AS stock,\r\n basic.basic_categoryid AS typeid,\r\n basic_thumbnails AS litpic,\r\n <#--列表页动态链接-->\r\n <#if isDo?? && isDo>\r\n CONCAT(\"/mmall/list.do?id=\", category.category_id) as typelink,\r\n <#else>\r\n (SELECT \"index.html\") AS typelink,\r\n </#if>\r\n <#--判断是否有自定义模型表-->\r\n <#if tableNname??>${tableNname}.*,</#if>\r\n category_title AS typetitle\r\nFROM\r\n mall_product \r\n LEFT JOIN basic ON mall_product.product_basicID = basic.basic_id\r\n LEFT JOIN category ON basic_categoryid = category.category_id\r\n LEFT JOIN basic_column ON basic_column.column_category_id = basic.basic_categoryid\r\n <#--判断是否有自定义模型表-->\r\n <#if tableNname??>LEFT JOIN ${tableNname} ON ${tableNname}.basicId=mall_product.product_basicID </#if>\r\nWHERE\r\n 1 = 1 <#if id??> and basic_id=${id} </#if>', null); INSERT INTO `mdiy_tag_sql` VALUES ('14', '13', 'SELECT\r\n basic_id AS id,\r\n product_price as price,\r\n product_cost_price AS costprice,\r\n product_content AS content,\r\n product_code AS code,\r\n <#--详情页动态链接-->\r\n <#if isDo?? && isDo>\r\n CONCAT(\"/${modelName}/view.do?id=\", basic_id) as link,\r\n <#else>\r\n product_linkUrl AS link,\r\n </#if>\r\n basic_title AS title,\r\n product_sale AS sale,\r\n product_good AS specification,\r\n product_inventory AS stock,\r\n basic.basic_categoryid AS typeid,\r\n basic_thumbnails AS litpic,\r\n <#--列表页动态链接-->\r\n <#if isDo?? && isDo>\r\n CONCAT(\"/mmall/list.do?id=\", category.category_id) as typelink,\r\n <#else>\r\n (SELECT \"index.html\") AS typelink,\r\n </#if>\r\n <#--判断是否有自定义模型表-->\r\n <#if tableNname??>${tableNname}.*,</#if>\r\n category_title AS typetitle\r\nFROM\r\n mall_product \r\n LEFT JOIN basic ON mall_product.product_basicID = basic.basic_id\r\n LEFT JOIN category ON basic_categoryid = category.category_id\r\n LEFT JOIN basic_column ON basic_column.column_category_id = basic.basic_categoryid\r\n <#--判断是否有自定义模型表-->\r\n <#if tableNname??>LEFT JOIN ${tableNname} ON ${tableNname}.basicId=mall_product.product_basicID </#if>\r\nWHERE\r\n 1 = 1 <#if id??> and basic_id=${id} </#if>', null);

View File

@ -914,9 +914,9 @@ INSERT INTO `mdiy_tag_sql` VALUES ('5', '3', '<#assign _typeid=\"\"/>\r\n<#if co
INSERT INTO `mdiy_tag_sql` VALUES ('6', '4', '<#assign _typeid=\"\"/>\r\n<#if column?? && column.categoryId??>\r\n <#assign _typeid=\"${column.categoryId}\">\r\n</#if>\r\n<#if typeid??>\r\n <#assign _typeid=\"${typeid}\">\r\n</#if>\r\nselect \r\n @rownum := @rownum + 1 AS typeindex,\r\n category_id as id,\r\n category_id as typeid,\r\n category_title as typetitle,\r\n <#--返回父id集合-->\r\n category_parent_id as pids,\r\n <#--栏目选中的样式-->\r\n IF(<#if _typeid?has_content>${_typeid}<#else>0</#if> = category_id ,\"${class!\'\'}\",\"\") as class,\r\n <#--动态链接-->\r\n <#if isDo?? && isDo>\r\n CONCAT(\"/${modelName}/list.do?typeid=\", category_id) as typelink,\r\n <#else>\r\n CONCAT(column_path,\"/index.html\") as typelink,\r\n </#if>\r\n column_keyword as typekeyword,\r\n column_descrip as typedescrip,\r\n category_smallimg as typelitpic \r\n from (SELECT @rownum := 0) r,category \r\n LEFT JOIN basic_column bc on bc.column_category_id=category.category_id where \r\n category.del=0 \r\n <#--根据模块编号查询分类-->\r\n <#if column?? && column.categoryModelId?has_content>\r\n and category_modelid=${column.categoryModelId}\r\n </#if>\r\n<#if type?has_content>\r\n <#--顶级栏目(单个)-->\r\n <#if type==\"top\">\r\n and category_id=(select left(category_parent_id,LOCATE(\",\",category_parent_id)-1) from category where category_id = ${_typeid})\r\n <#elseif type==\"nav\">\r\n and(category_categoryid=0 or category_categoryid is null)\r\n <#--同级栏目(多个)-->\r\n <#elseif type==\"level\">\r\n and\r\n <#if _typeid?has_content>\r\n category_categoryid=(select category_categoryid from category where category_id=${_typeid})\r\n <#else>\r\n 1=1\r\n </#if>\r\n <#--当前栏目(单个)-->\r\n <#elseif type==\"self\">\r\n and \r\n <#if _typeid?has_content>\r\n category_id=${_typeid}\r\n <#else>\r\n 1=1\r\n </#if>\r\n <#--当前栏目的所属栏目(多个)-->\r\n <#elseif type==\"path\">\r\n and \r\n <#if _typeid?has_content>\r\n category_id in (<#if column?? && column.categoryParentId??>${column.categoryParentId},</#if>${_typeid})\r\n <#else>\r\n 1=1\r\n </#if>\r\n <#--子栏目(多个)-->\r\n <#elseif type==\"son\">\r\n and \r\n <#if _typeid?has_content>\r\n category_categoryid=${_typeid}\r\n <#else>\r\n 1=1\r\n </#if>\r\n <#--上一级栏目没有则取当前栏目(单个)-->\r\n <#elseif type==\"parent\">\r\n and \r\n <#if _typeid?has_content>\r\n <#if column?? && column.categoryCategoryId?? && column.categoryCategoryId!=0>\r\n category_id=${column.categoryCategoryId}\r\n <#else>\r\n category_id=${_typeid}\r\n </#if>\r\n <#else>\r\n 1=1\r\n </#if>\r\n <#--子栏目或同级栏目(多个)-->\r\n <#elseif type==\"sonOrLevel\">\r\n and \r\n <#if _typeid?has_content>\r\n category_categoryid= if((SELECT count(*) FROM category\r\n LEFT JOIN basic_column bc ON bc.column_category_id = category.category_id \r\n WHERE category_categoryid=${_typeid})>0,${_typeid},(select category_categoryid from category where category_id=${_typeid}))\r\n <#else>\r\n 1=1\r\n </#if>\r\n </#if>\r\n<#else> <#--默认son-->\r\n and\r\n <#if _typeid?has_content>\r\n category_categoryid=${_typeid}\r\n <#else>\r\n (category_categoryid=0 or category_categoryid is null)\r\n </#if>\r\n</#if>', '1'); INSERT INTO `mdiy_tag_sql` VALUES ('6', '4', '<#assign _typeid=\"\"/>\r\n<#if column?? && column.categoryId??>\r\n <#assign _typeid=\"${column.categoryId}\">\r\n</#if>\r\n<#if typeid??>\r\n <#assign _typeid=\"${typeid}\">\r\n</#if>\r\nselect \r\n @rownum := @rownum + 1 AS typeindex,\r\n category_id as id,\r\n category_id as typeid,\r\n category_title as typetitle,\r\n <#--返回父id集合-->\r\n category_parent_id as pids,\r\n <#--栏目选中的样式-->\r\n IF(<#if _typeid?has_content>${_typeid}<#else>0</#if> = category_id ,\"${class!\'\'}\",\"\") as class,\r\n <#--动态链接-->\r\n <#if isDo?? && isDo>\r\n CONCAT(\"/${modelName}/list.do?typeid=\", category_id) as typelink,\r\n <#else>\r\n CONCAT(column_path,\"/index.html\") as typelink,\r\n </#if>\r\n column_keyword as typekeyword,\r\n column_descrip as typedescrip,\r\n category_smallimg as typelitpic \r\n from (SELECT @rownum := 0) r,category \r\n LEFT JOIN basic_column bc on bc.column_category_id=category.category_id where \r\n category.del=0 \r\n <#--根据模块编号查询分类-->\r\n <#if column?? && column.categoryModelId?has_content>\r\n and category_modelid=${column.categoryModelId}\r\n </#if>\r\n<#if type?has_content>\r\n <#--顶级栏目(单个)-->\r\n <#if type==\"top\">\r\n and category_id=(select left(category_parent_id,LOCATE(\",\",category_parent_id)-1) from category where category_id = ${_typeid})\r\n <#elseif type==\"nav\">\r\n and(category_categoryid=0 or category_categoryid is null)\r\n <#--同级栏目(多个)-->\r\n <#elseif type==\"level\">\r\n and\r\n <#if _typeid?has_content>\r\n category_categoryid=(select category_categoryid from category where category_id=${_typeid})\r\n <#else>\r\n 1=1\r\n </#if>\r\n <#--当前栏目(单个)-->\r\n <#elseif type==\"self\">\r\n and \r\n <#if _typeid?has_content>\r\n category_id=${_typeid}\r\n <#else>\r\n 1=1\r\n </#if>\r\n <#--当前栏目的所属栏目(多个)-->\r\n <#elseif type==\"path\">\r\n and \r\n <#if _typeid?has_content>\r\n category_id in (<#if column?? && column.categoryParentId??>${column.categoryParentId},</#if>${_typeid})\r\n <#else>\r\n 1=1\r\n </#if>\r\n <#--子栏目(多个)-->\r\n <#elseif type==\"son\">\r\n and \r\n <#if _typeid?has_content>\r\n category_categoryid=${_typeid}\r\n <#else>\r\n 1=1\r\n </#if>\r\n <#--上一级栏目没有则取当前栏目(单个)-->\r\n <#elseif type==\"parent\">\r\n and \r\n <#if _typeid?has_content>\r\n <#if column?? && column.categoryCategoryId?? && column.categoryCategoryId!=0>\r\n category_id=${column.categoryCategoryId}\r\n <#else>\r\n category_id=${_typeid}\r\n </#if>\r\n <#else>\r\n 1=1\r\n </#if>\r\n <#--子栏目或同级栏目(多个)-->\r\n <#elseif type==\"sonOrLevel\">\r\n and \r\n <#if _typeid?has_content>\r\n category_categoryid= if((SELECT count(*) FROM category\r\n LEFT JOIN basic_column bc ON bc.column_category_id = category.category_id \r\n WHERE category_categoryid=${_typeid})>0,${_typeid},(select category_categoryid from category where category_id=${_typeid}))\r\n <#else>\r\n 1=1\r\n </#if>\r\n </#if>\r\n<#else> <#--默认son-->\r\n and\r\n <#if _typeid?has_content>\r\n category_categoryid=${_typeid}\r\n <#else>\r\n (category_categoryid=0 or category_categoryid is null)\r\n </#if>\r\n</#if>', '1');
INSERT INTO `mdiy_tag_sql` VALUES ('7', '5', 'select \r\nAPP_NAME as name,\r\napp_logo as logo,\r\napp_keyword as keyword,\r\napp_description as descrip,\r\napp_copyright as copyright,\r\n<#--动态解析 -->\r\n<#if isDo?? && isDo>\r\n\"${url}\" as url,\r\n\"${url}\" as host,\r\n<#--使用地址栏的域名 -->\r\n<#elseif url??>\r\nCONCAT(\"${url}\",\"/${html}/\",app_id,\"/<#if m??>${m}</#if>\") as url,\r\n\"${url}\" as host,\r\n<#else>\r\nCONCAT(REPLACE(REPLACE(TRIM(substring_index(app_url,\"\\n\",1)), CHAR(10),\'\'), CHAR(13),\'\'),\"/html/\",app_id,\"/<#if m??>${m}</#if>\") as url,\r\nREPLACE(REPLACE(TRIM(substring_index(app_url,\"\\n\",1)), CHAR(10),\'\'), CHAR(13),\'\') as host,\r\n</#if>\r\nCONCAT(\"templets/\",app_id,\"/\",<#if m??>CONCAT(app_style,\"/${m}\")<#else>app_style</#if>) as style <#-- 判断是否为手机端 -->\r\nfrom app limit 1', '1'); INSERT INTO `mdiy_tag_sql` VALUES ('7', '5', 'select \r\nAPP_NAME as name,\r\napp_logo as logo,\r\napp_keyword as keyword,\r\napp_description as descrip,\r\napp_copyright as copyright,\r\n<#--动态解析 -->\r\n<#if isDo?? && isDo>\r\n\"${url}\" as url,\r\n\"${url}\" as host,\r\n<#--使用地址栏的域名 -->\r\n<#elseif url??>\r\nCONCAT(\"${url}\",\"/${html}/\",app_id,\"/<#if m??>${m}</#if>\") as url,\r\n\"${url}\" as host,\r\n<#else>\r\nCONCAT(REPLACE(REPLACE(TRIM(substring_index(app_url,\"\\n\",1)), CHAR(10),\'\'), CHAR(13),\'\'),\"/html/\",app_id,\"/<#if m??>${m}</#if>\") as url,\r\nREPLACE(REPLACE(TRIM(substring_index(app_url,\"\\n\",1)), CHAR(10),\'\'), CHAR(13),\'\') as host,\r\n</#if>\r\nCONCAT(\"templets/\",app_id,\"/\",<#if m??>CONCAT(app_style,\"/${m}\")<#else>app_style</#if>) as style <#-- 判断是否为手机端 -->\r\nfrom app limit 1', '1');
INSERT INTO `mdiy_tag_sql` VALUES ('8', '7', 'SELECT \r\nbasic_id as id,\r\nleft(basic_title,${titlelen?default(40)}) as title,\r\nbasic_title as fulltitle,\r\narticle_author as author, \r\narticle_source as source, \r\narticle_content as content,\r\ncategory.category_title as typetitle,\r\ncategory.category_id as typeid,\r\ncategory.category_smallimg AS typelitpic,\r\n<#--动态链接-->\r\n<#if isDo?? && isDo>\r\nCONCAT(\"/${modelName}/list.do?typeid=\", category.category_id) as typelink,\r\n<#else>\r\n(SELECT \"index.html\") as typelink,\r\n</#if>\r\nbasic.basic_thumbnails as litpic,\r\n<#--内容页动态链接-->\r\n<#if isDo?? && isDo>\r\nCONCAT(\"/mcms/view.do?id=\", basic_id) as link,\r\n<#else>\r\ncms_article.article_url AS link,\r\n</#if>\r\nbasic_datetime as date,\r\nbasic_description as descrip,\r\nCONCAT(\"<script type=\'text/javascript\' src=\'${url}/basic/\",basic_id,\"/hit.do\'></script>\") as hit,\r\narticle_type as flag,\r\ncategory_title as typetitle,\r\n<#if tableName??>${tableName}.*,</#if>\r\ncms_article.article_keyword as keyword\r\nFROM basic LEFT JOIN cms_article ON cms_article.article_basicid = basic.basic_id \r\nLEFT JOIN category ON basic_categoryid=category.category_id \r\nLEFT JOIN basic_column ON basic_column.column_category_id=basic.basic_categoryid\r\n<#--判断是否有自定义模型表-->\r\n<#if tableName??>left join ${tableName} on ${tableName}.basicId=cms_article.ARTICLE_BASICID</#if>\r\nWHERE \r\n1=1\r\n<#if id??> and basic_id=${id}</#if>', '1'); INSERT INTO `mdiy_tag_sql` VALUES ('8', '7', 'SELECT \r\nbasic_id as id,\r\nleft(basic_title,${titlelen?default(40)}) as title,\r\nbasic_title as fulltitle,\r\narticle_author as author, \r\narticle_source as source, \r\narticle_content as content,\r\ncategory.category_title as typetitle,\r\ncategory.category_id as typeid,\r\ncategory.category_smallimg AS typelitpic,\r\n<#--动态链接-->\r\n<#if isDo?? && isDo>\r\nCONCAT(\"/${modelName}/list.do?typeid=\", category.category_id) as typelink,\r\n<#else>\r\n(SELECT \"index.html\") as typelink,\r\n</#if>\r\nbasic.basic_thumbnails as litpic,\r\n<#--内容页动态链接-->\r\n<#if isDo?? && isDo>\r\nCONCAT(\"/mcms/view.do?id=\", basic_id) as link,\r\n<#else>\r\ncms_article.article_url AS link,\r\n</#if>\r\nbasic_datetime as date,\r\nbasic_description as descrip,\r\nCONCAT(\"<script type=\'text/javascript\' src=\'${url}/basic/\",basic_id,\"/hit.do\'></script>\") as hit,\r\narticle_type as flag,\r\ncategory_title as typetitle,\r\n<#if tableName??>${tableName}.*,</#if>\r\ncms_article.article_keyword as keyword\r\nFROM basic LEFT JOIN cms_article ON cms_article.article_basicid = basic.basic_id \r\nLEFT JOIN category ON basic_categoryid=category.category_id \r\nLEFT JOIN basic_column ON basic_column.column_category_id=basic.basic_categoryid\r\n<#--判断是否有自定义模型表-->\r\n<#if tableName??>left join ${tableName} on ${tableName}.basicId=cms_article.ARTICLE_BASICID</#if>\r\nWHERE \r\n1=1\r\n<#if id??> and basic_id=${id}</#if>', '1');
INSERT INTO `mdiy_tag_sql` VALUES ('9', '8', '<#assign select=\"(SELECT \'\')\"/>\r\n<#if (pageTag.preId)??>\r\nSELECT \r\nbasic_id as id,\r\nleft(basic_title,${titlelen?default(40)}) as title,\r\nbasic_title as fulltitle,\r\narticle_author as author, \r\narticle_source as source, \r\narticle_content as content,\r\ncategory.category_title as typename,\r\ncategory.category_id as typeid,\r\n(SELECT \"index.html\") AS typelink,\r\nbasic.basic_thumbnails as litpic,\r\ncms_article.article_url as link,\r\nbasic_datetime as date,\r\nbasic_description as descrip,\r\nbasic_hit as hit,\r\narticle_type as flag,\r\ncms_article.article_keyword as keyword \r\nFROM basic LEFT JOIN cms_article ON cms_article.article_basicid = basic.basic_id \r\nLEFT JOIN category ON basic_categoryid=category.category_id \r\nLEFT JOIN basic_column ON basic_column.column_category_id=basic.basic_categoryid \r\nWHERE basic_id=${pageTag.preId}\r\n<#else><#--没有上一页返回空字符串-->\r\nSELECT \r\n${select} as id,\r\n${select} as title,\r\n${select} as fulltitle,\r\n${select} as author, \r\n${select} as source, \r\n${select} as content,\r\n${select} as typename,\r\n${select} as typeid,\r\n${select} as typelink,\r\n${select} as litpic,\r\n${select} as link,\r\n${select} as date,\r\n${select} as descrip,\r\n${select} as hit,\r\n${select} as flag,\r\n${select} as keyword FROM basic\r\n</#if>', null); INSERT INTO `mdiy_tag_sql` VALUES ('9', '8', '<#assign select=\"(SELECT \'\')\"/>\r\n<#if (pageTag.preId)gt 0>\r\nSELECT \r\nbasic_id as id,\r\nleft(basic_title,${titlelen?default(40)}) as title,\r\nbasic_title as fulltitle,\r\narticle_author as author, \r\narticle_source as source, \r\narticle_content as content,\r\ncategory.category_title as typename,\r\ncategory.category_id as typeid,\r\n(SELECT \"index.html\") AS typelink,\r\nbasic.basic_thumbnails as litpic,\r\ncms_article.article_url as link,\r\nbasic_datetime as date,\r\nbasic_description as descrip,\r\nbasic_hit as hit,\r\narticle_type as flag,\r\ncms_article.article_keyword as keyword \r\nFROM basic LEFT JOIN cms_article ON cms_article.article_basicid = basic.basic_id \r\nLEFT JOIN category ON basic_categoryid=category.category_id \r\nLEFT JOIN basic_column ON basic_column.column_category_id=basic.basic_categoryid \r\nWHERE basic_id=${pageTag.preId}\r\n<#else><#--没有上一页返回空字符串-->\r\nSELECT \r\n${select} as id,\r\n${select} as title,\r\n${select} as fulltitle,\r\n${select} as author, \r\n${select} as source, \r\n${select} as content,\r\n${select} as typename,\r\n${select} as typeid,\r\n${select} as typelink,\r\n${select} as litpic,\r\n${select} as link,\r\n${select} as date,\r\n${select} as descrip,\r\n${select} as hit,\r\n${select} as flag,\r\n${select} as keyword FROM basic\r\n</#if>', null);
INSERT INTO `mdiy_tag_sql` VALUES ('10', '9', ' select\r\n <#if !(pageTag.indexUrl??)>\r\n <#--判断是否有栏目对象,用于搜索不传栏目-->\r\n <#if column??>\r\n <#--顶级栏目处理-->\r\n <#if column.categoryCategoryId==0>\r\n <#assign path=column.columnPath/>\r\n <#else>\r\n <#assign path=column.columnPath/>\r\n </#if>\r\n <#else>\r\n <#assign path=\"\"/>\r\n </#if>\r\n <#--总记录数、总页数-->\r\n (SELECT ${pageTag.total}) as total,\r\n <#--记录总数-->\r\n (SELECT ${pageTag.size}) as rcount,\r\n <#--当前页码-->\r\n (SELECT ${pageTag.pageNo}) as cur,\r\n <#--首页-->\r\n CONCAT(\"${path}\", \"/index.html\") as `index`,\r\n <#--上一页-->\r\n <#if (pageTag.pageNo?eval-1) gt 1>\r\n CONCAT(\"${path}\",\"/list-${pageTag.pageNo?eval-1}.html\") as pre,\r\n <#else>\r\n CONCAT(\"${path}\",\"/index.html\") as pre,\r\n </#if>\r\n <#--下一页-->\r\n <#if pageTag.total==1>\r\n CONCAT(\"${path}\", \"/index.html\") as `next`,\r\n CONCAT(\"${path}\", \"/index.html\") as `last`\r\n <#else>\r\n <#if pageTag.pageNo?eval gte pageTag.total>\r\n CONCAT(\"${path}\",\"/list-${pageTag.total}.html\") as next,\r\n <#else>\r\n CONCAT(\"${path}\",\"/list-${pageTag.pageNo?eval+1}.html\") as next,\r\n </#if>\r\n <#--最后一页-->\r\n CONCAT(\"${path}\",\"/list-${pageTag.total}.html\") as last\r\n </#if>\r\n<#else><#--判断是否是搜索页面-->\r\n \"${pageTag.indexUrl}\" as `index`,\"${pageTag.lastUrl}\" as `last`,\"${pageTag.preUrl}\" as `pre`,\"${pageTag.nextUrl}\" as `next`,\'${pageTag.total}\' as total,\'${pageTag.size}\' as rcount,\'${pageTag.pageNo}\' as cur\r\n</#if>', null); INSERT INTO `mdiy_tag_sql` VALUES ('10', '9', ' select\r\n <#if !(pageTag.indexUrl??)>\r\n <#--判断是否有栏目对象,用于搜索不传栏目-->\r\n <#if column??>\r\n <#--顶级栏目处理-->\r\n <#if column.categoryCategoryId==0>\r\n <#assign path=column.columnPath/>\r\n <#else>\r\n <#assign path=column.columnPath/>\r\n </#if>\r\n <#else>\r\n <#assign path=\"\"/>\r\n </#if>\r\n <#--总记录数、总页数-->\r\n (SELECT ${pageTag.total}) as total,\r\n <#--记录总数-->\r\n (SELECT ${pageTag.size}) as rcount,\r\n <#--当前页码-->\r\n (SELECT ${pageTag.pageNo}) as cur,\r\n <#--首页-->\r\n CONCAT(\"${path}\", \"/index.html\") as `index`,\r\n <#--上一页-->\r\n <#if (pageTag.pageNo?eval-1) gt 1>\r\n CONCAT(\"${path}\",\"/list-${pageTag.pageNo?eval-1}.html\") as pre,\r\n <#else>\r\n CONCAT(\"${path}\",\"/index.html\") as pre,\r\n </#if>\r\n <#--下一页-->\r\n <#if pageTag.total==1>\r\n CONCAT(\"${path}\", \"/index.html\") as `next`,\r\n CONCAT(\"${path}\", \"/index.html\") as `last`\r\n <#else>\r\n <#if pageTag.pageNo?eval gte pageTag.total>\r\n CONCAT(\"${path}\",\"/list-${pageTag.total}.html\") as next,\r\n <#else>\r\n CONCAT(\"${path}\",\"/list-${pageTag.pageNo?eval+1}.html\") as next,\r\n </#if>\r\n <#--最后一页-->\r\n CONCAT(\"${path}\",\"/list-${pageTag.total}.html\") as last\r\n </#if>\r\n<#else><#--判断是否是搜索页面-->\r\n \"${pageTag.indexUrl}\" as `index`,\"${pageTag.lastUrl}\" as `last`,\"${pageTag.preUrl}\" as `pre`,\"${pageTag.nextUrl}\" as `next`,\'${pageTag.total}\' as total,\'${pageTag.size}\' as rcount,\'${pageTag.pageNo}\' as cur\r\n</#if>', null);
INSERT INTO `mdiy_tag_sql` VALUES ('11', '10', '<#assign select=\"(SELECT \'\')\"/>\r\n<#if (pageTag.nextId)??>\r\nSELECT \r\nbasic_id as id,\r\nleft(basic_title,${titlelen?default(40)}) as title,\r\nbasic_title as fulltitle,\r\narticle_author as author, \r\narticle_source as source, \r\narticle_content as content,\r\ncategory.category_title as typename,\r\ncategory.category_id as typeid,\r\n(SELECT \"index.html\") as typelink,\r\nbasic.basic_thumbnails as litpic,\r\ncms_article.article_url as link,\r\nbasic_datetime as date,\r\nbasic_description as descrip,\r\nbasic_hit as hit,\r\narticle_type as flag,\r\ncms_article.article_keyword as keyword \r\nFROM basic LEFT JOIN cms_article ON cms_article.article_basicid = basic.basic_id \r\nLEFT JOIN category ON basic_categoryid=category.category_id \r\nLEFT JOIN basic_column ON basic_column.column_category_id=basic.basic_categoryid \r\nWHERE basic_id=${pageTag.nextId}\r\n<#else>\r\nSELECT \r\n${select} as id,\r\n${select} as title,\r\n${select} as fulltitle,\r\n${select} as author, \r\n${select} as source, \r\n${select} as content,\r\n${select} as typename,\r\n${select} as typeid,\r\n${select} as typelink,\r\n${select} as litpic,\r\n${select} as link,\r\n${select} as date,\r\n${select} as descrip,\r\n${select} as hit,\r\n${select} as flag,\r\n${select} as keyword FROM basic\r\n</#if>', null); INSERT INTO `mdiy_tag_sql` VALUES ('11', '10', '<#assign select=\"(SELECT \'\')\"/>\r\n<#if (pageTag.nextId)gt 0>\r\nSELECT \r\nbasic_id as id,\r\nleft(basic_title,${titlelen?default(40)}) as title,\r\nbasic_title as fulltitle,\r\narticle_author as author, \r\narticle_source as source, \r\narticle_content as content,\r\ncategory.category_title as typename,\r\ncategory.category_id as typeid,\r\n(SELECT \"index.html\") as typelink,\r\nbasic.basic_thumbnails as litpic,\r\ncms_article.article_url as link,\r\nbasic_datetime as date,\r\nbasic_description as descrip,\r\nbasic_hit as hit,\r\narticle_type as flag,\r\ncms_article.article_keyword as keyword \r\nFROM basic LEFT JOIN cms_article ON cms_article.article_basicid = basic.basic_id \r\nLEFT JOIN category ON basic_categoryid=category.category_id \r\nLEFT JOIN basic_column ON basic_column.column_category_id=basic.basic_categoryid \r\nWHERE basic_id=${pageTag.nextId}\r\n<#else>\r\nSELECT \r\n${select} as id,\r\n${select} as title,\r\n${select} as fulltitle,\r\n${select} as author, \r\n${select} as source, \r\n${select} as content,\r\n${select} as typename,\r\n${select} as typeid,\r\n${select} as typelink,\r\n${select} as litpic,\r\n${select} as link,\r\n${select} as date,\r\n${select} as descrip,\r\n${select} as hit,\r\n${select} as flag,\r\n${select} as keyword FROM basic\r\n</#if>', null);
INSERT INTO `mdiy_tag_sql` VALUES ('13', '12', 'SELECT\r\n basic_id AS id,\r\n product_price as price,\r\n product_cost_price AS costprice,\r\n product_content AS content,\r\n product_code AS code,\r\n <#--详情页动态链接-->\r\n <#if isDo?? && isDo>\r\n CONCAT(\"/${modelName}/view.do?id=\", basic_id) as link,\r\n <#else>\r\n product_linkUrl AS link,\r\n </#if>\r\n basic_title AS title,\r\n product_sale AS sale,\r\n product_good AS specification,\r\n product_inventory AS stock,\r\n basic.basic_categoryid AS typeid,\r\n basic_thumbnails AS litpic,\r\n <#--列表页动态链接-->\r\n <#if isDo?? && isDo>\r\n CONCAT(\"/mmall/list.do?typeid=\", category.category_id) as typelink,\r\n <#else>\r\n (SELECT \"index.html\") AS typelink,\r\n </#if>\r\n <#--判断是否有自定义模型表-->\r\n <#if tableNname??>${tableNname}.*,</#if>\r\n category_title AS typetitle\r\nFROM\r\n mall_product \r\n LEFT JOIN basic ON mall_product.product_basicID = basic.basic_id\r\n LEFT JOIN category ON basic_categoryid = category.category_id\r\n <#--判断是否有自定义模型表-->\r\n <#if tableNname??>LEFT JOIN ${tableNname} ON ${tableNname}.basicId=mall_product.product_basicID </#if>\r\nWHERE\r\n 1 = 1 <#--查询栏目-->\r\n <#if (typeid)??> and (basic_categoryid=${typeid} or basic_categoryid in \r\n (select category_id FROM category where find_in_set(${typeid},CATEGORY_PARENT_ID)))\r\n </#if>\r\n <#--模糊查询商品标题-->\r\n <#if basic_title??> and basic_title like CONCAT(\"%\",\'${basic_title}\',\"%\")</#if> \r\n LIMIT <#--判断是否分页-->\r\n <#if ispaging?? && pageNo??>${(pageNo?eval-1)*size?eval},${size?default(20)}\r\n <#else>${size?default(20)}</#if>', null); INSERT INTO `mdiy_tag_sql` VALUES ('13', '12', 'SELECT\r\n basic_id AS id,\r\n product_price as price,\r\n product_cost_price AS costprice,\r\n product_content AS content,\r\n product_code AS code,\r\n <#--详情页动态链接-->\r\n <#if isDo?? && isDo>\r\n CONCAT(\"/${modelName}/view.do?id=\", basic_id) as link,\r\n <#else>\r\n product_linkUrl AS link,\r\n </#if>\r\n basic_title AS title,\r\n product_sale AS sale,\r\n product_good AS specification,\r\n product_inventory AS stock,\r\n basic.basic_categoryid AS typeid,\r\n basic_thumbnails AS litpic,\r\n <#--列表页动态链接-->\r\n <#if isDo?? && isDo>\r\n CONCAT(\"/mmall/list.do?typeid=\", category.category_id) as typelink,\r\n <#else>\r\n (SELECT \"index.html\") AS typelink,\r\n </#if>\r\n <#--判断是否有自定义模型表-->\r\n <#if tableNname??>${tableNname}.*,</#if>\r\n category_title AS typetitle\r\nFROM\r\n mall_product \r\n LEFT JOIN basic ON mall_product.product_basicID = basic.basic_id\r\n LEFT JOIN category ON basic_categoryid = category.category_id\r\n <#--判断是否有自定义模型表-->\r\n <#if tableNname??>LEFT JOIN ${tableNname} ON ${tableNname}.basicId=mall_product.product_basicID </#if>\r\nWHERE\r\n 1 = 1 <#--查询栏目-->\r\n <#if (typeid)??> and (basic_categoryid=${typeid} or basic_categoryid in \r\n (select category_id FROM category where find_in_set(${typeid},CATEGORY_PARENT_ID)))\r\n </#if>\r\n <#--模糊查询商品标题-->\r\n <#if basic_title??> and basic_title like CONCAT(\"%\",\'${basic_title}\',\"%\")</#if> \r\n LIMIT <#--判断是否分页-->\r\n <#if ispaging?? && pageNo??>${(pageNo?eval-1)*size?eval},${size?default(20)}\r\n <#else>${size?default(20)}</#if>', null);
INSERT INTO `mdiy_tag_sql` VALUES ('14', '13', 'SELECT\r\n basic_id AS id,\r\n product_price as price,\r\n product_cost_price AS costprice,\r\n product_content AS content,\r\n product_code AS code,\r\n <#--详情页动态链接-->\r\n <#if isDo?? && isDo>\r\n CONCAT(\"/${modelName}/view.do?id=\", basic_id) as link,\r\n <#else>\r\n product_linkUrl AS link,\r\n </#if>\r\n basic_title AS title,\r\n product_sale AS sale,\r\n product_good AS specification,\r\n product_inventory AS stock,\r\n basic.basic_categoryid AS typeid,\r\n basic_thumbnails AS litpic,\r\n <#--列表页动态链接-->\r\n <#if isDo?? && isDo>\r\n CONCAT(\"/mmall/list.do?id=\", category.category_id) as typelink,\r\n <#else>\r\n (SELECT \"index.html\") AS typelink,\r\n </#if>\r\n <#--判断是否有自定义模型表-->\r\n <#if tableNname??>${tableNname}.*,</#if>\r\n category_title AS typetitle\r\nFROM\r\n mall_product \r\n LEFT JOIN basic ON mall_product.product_basicID = basic.basic_id\r\n LEFT JOIN category ON basic_categoryid = category.category_id\r\n LEFT JOIN basic_column ON basic_column.column_category_id = basic.basic_categoryid\r\n <#--判断是否有自定义模型表-->\r\n <#if tableNname??>LEFT JOIN ${tableNname} ON ${tableNname}.basicId=mall_product.product_basicID </#if>\r\nWHERE\r\n 1 = 1 <#if id??> and basic_id=${id} </#if>', null); INSERT INTO `mdiy_tag_sql` VALUES ('14', '13', 'SELECT\r\n basic_id AS id,\r\n product_price as price,\r\n product_cost_price AS costprice,\r\n product_content AS content,\r\n product_code AS code,\r\n <#--详情页动态链接-->\r\n <#if isDo?? && isDo>\r\n CONCAT(\"/${modelName}/view.do?id=\", basic_id) as link,\r\n <#else>\r\n product_linkUrl AS link,\r\n </#if>\r\n basic_title AS title,\r\n product_sale AS sale,\r\n product_good AS specification,\r\n product_inventory AS stock,\r\n basic.basic_categoryid AS typeid,\r\n basic_thumbnails AS litpic,\r\n <#--列表页动态链接-->\r\n <#if isDo?? && isDo>\r\n CONCAT(\"/mmall/list.do?id=\", category.category_id) as typelink,\r\n <#else>\r\n (SELECT \"index.html\") AS typelink,\r\n </#if>\r\n <#--判断是否有自定义模型表-->\r\n <#if tableNname??>${tableNname}.*,</#if>\r\n category_title AS typetitle\r\nFROM\r\n mall_product \r\n LEFT JOIN basic ON mall_product.product_basicID = basic.basic_id\r\n LEFT JOIN category ON basic_categoryid = category.category_id\r\n LEFT JOIN basic_column ON basic_column.column_category_id = basic.basic_categoryid\r\n <#--判断是否有自定义模型表-->\r\n <#if tableNname??>LEFT JOIN ${tableNname} ON ${tableNname}.basicId=mall_product.product_basicID </#if>\r\nWHERE\r\n 1 = 1 <#if id??> and basic_id=${id} </#if>', null);

View File

@ -160,8 +160,12 @@ public class SearchAction extends BaseAction {
ContentModelEntity contentModel = null; // 栏目对应模型 ContentModelEntity contentModel = null; // 栏目对应模型
List<ContentModelFieldEntity> fieldList = new ArrayList<ContentModelFieldEntity>(); // 栏目对应字段 List<ContentModelFieldEntity> fieldList = new ArrayList<ContentModelFieldEntity>(); // 栏目对应字段
List<DiyModelMap> fieldValueList = new ArrayList<DiyModelMap>(); // 栏目对应字段的值 List<DiyModelMap> fieldValueList = new ArrayList<DiyModelMap>(); // 栏目对应字段的值
int typeId = BasicUtil.getInt("typeid",0); int typeId = 0;
String categoryIds = BasicUtil.getString("categoryId"); String categoryIds = BasicUtil.getString("categoryId");
//当传递了栏目编号但不是栏目集合
if(!StringUtil.isBlank(categoryIds) && !categoryIds.contains(",")){
typeId = Integer.parseInt(categoryIds);
}
//记录自定义模型字段名 //记录自定义模型字段名
List filedStr = new ArrayList<>(); List filedStr = new ArrayList<>();
//根据栏目确定自定义模型 //根据栏目确定自定义模型

View File

@ -458,10 +458,10 @@
left join basic_column cl left join basic_column cl
on c.CATEGORY_ID = on c.CATEGORY_ID =
cl.COLUMN_CATEGORY_ID cl.COLUMN_CATEGORY_ID
<if test="tableName!=null">left join ${tableName} d on d.basicId=a.ARTICLE_BASICID <if test="tableName!=null and tableName!=''">left join ${tableName} d on d.basicId=a.ARTICLE_BASICID
</if> </if>
where a.ARTICLE_WEBID = #{websiteId} where a.ARTICLE_WEBID = #{websiteId}
<if test="ids!=null"> <if test="ids!=null and ids!=''">
and FIND_IN_SET(category_categoryid,'${ids}') and FIND_IN_SET(category_categoryid,'${ids}')
</if> </if>
<foreach item="item" index="key" collection="map" open="" <foreach item="item" index="key" collection="map" open=""