浏览代码

搜索分页切换两次问题、文章管理父级栏目不显示子栏目文章问题

sgjj 5 年之前
父节点
当前提交
5a360c5a74

+ 3 - 3
src/main/java/net/mingsoft/cms/action/web/MCmsAction.java

@@ -385,7 +385,9 @@ public class MCmsAction extends net.mingsoft.cms.action.BaseAction {
 			//sql注入过滤
 			searchMap.put(k,v.toString().replaceAll("('|\"|\\\\)","\\\\$1"));
 			searchMap.put(k,clearXss(searchMap.get(k).toString()));
-			urlParams.append(k).append("=").append(searchMap.get(k)).append("&");
+			if(!ParserUtil.SIZE.equals(k)&&!ParserUtil.PAGE_NO.equals(k)){
+				urlParams.append(k).append("=").append(searchMap.get(k)).append("&");
+			}
 		});
 
 		//查询数量
@@ -429,8 +431,6 @@ public class MCmsAction extends net.mingsoft.cms.action.BaseAction {
 		page.setPreUrl(preUrl);
 		page.setLastUrl(lastUrl);
 
-		searchMap.put(ParserUtil.PAGE_NO, pageNo);
-
 		//解析后的内容
 		String content = "";
 		try {

+ 2 - 1
src/main/java/net/mingsoft/cms/dao/IContentDao.xml

@@ -225,7 +225,8 @@
 		<where>
 			ct.del=0
 			<if test="contentTitle != null and contentTitle != ''"> and  content_title like CONCAT('%',#{contentTitle},'%')</if>
-			<if test="contentCategoryId != null and contentCategoryId != ''"> and content_category_id=#{contentCategoryId}</if>
+			<if test="contentCategoryId != null and contentCategoryId != ''"> 	and (content_category_id=#{contentCategoryId} or content_category_id in
+				(select id FROM cms_category where <include refid="queryWhereCategoryId"></include>))</if>
 			<if test="contentType != null and contentType != ''"> and content_type LIKE CONCAT('%',#{contentType},'%')</if>
 			<if test="contentDisplay != null and contentDisplay != ''"> and content_display=#{contentDisplay}</if>
 			<if test="contentAuthor != null and contentAuthor != ''"> and content_author=#{contentAuthor}</if>