Pārlūkot izejas kodu

规范栏目属性字段名称

msgroup 4 gadi atpakaļ
vecāks
revīzija
3c3a8c8265

+ 1 - 1
src/main/java/net/mingsoft/cms/action/GeneraterAction.java

@@ -178,7 +178,7 @@ public class GeneraterAction extends BaseAction {
 
             ContentBean contentBean = new ContentBean();
             contentBean.setCategoryId(column.getId());
-
+            contentBean.setCategoryType(column.getCategoryType());
             articleIdList = contentBiz.queryIdsByCategoryIdForParser(contentBean);
             // 判断列表类型
             switch (CategoryTypeEnum.get(column.getCategoryType())) {

+ 13 - 0
src/main/java/net/mingsoft/cms/bean/ContentBean.java

@@ -62,6 +62,11 @@ public class ContentBean extends ContentEntity {
      */
     private String categoryType;
 
+    /**
+     * 栏目属性,用于筛选文章列表
+     */
+    private String categoryFlag;
+
     public String getCategoryType() {
         return categoryType;
     }
@@ -70,6 +75,14 @@ public class ContentBean extends ContentEntity {
         this.categoryType = categoryType;
     }
 
+    public String getCategoryFlag() {
+        return categoryFlag;
+    }
+
+    public void setCategoryFlag(String categoryFlag) {
+        this.categoryFlag = categoryFlag;
+    }
+
     public String getBeginTime() {
         return beginTime;
     }

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

@@ -250,10 +250,13 @@
 			where ct.del=0
 
 			<!-- 查询子栏目数据 -->
-			<if test="categoryId &gt; 0">
+			<if test="categoryId!=null and  categoryId!='' and categoryType==1">
 				and (ct.category_id=#{categoryId} or ct.category_id in
 				(select id FROM cms_category where find_in_set('${categoryId}',CATEGORY_PARENT_IDS)>0))
 			</if>
+			<if test="categoryId!=null and  categoryId!='' and categoryType==2">
+				ct.category_id=#{categoryId}
+			</if>
 			<if test="beginTime!=null and beginTime!=''">
 				<if test="_databaseId == 'mysql'">
 					and content_datetime &gt;= #{beginTime}

+ 2 - 2
src/main/webapp/WEB-INF/manager/cms/content/main.ftl

@@ -33,8 +33,8 @@
                         </el-form-item>
                     </el-col>
                     <el-col :span="8">
-                        <el-form-item  label="文章类型" prop="contentType">
-                            <el-select v-model="form.contentType"
+                        <el-form-item  label="文章类型" prop="categoryFlag">
+                            <el-select v-model="form.categoryFlag"
                                        :style="{width: '100%'}"
                                        :filterable="false"
                                        :disabled="false"