tianbj 5 lat temu
rodzic
commit
56de943904

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

@@ -185,7 +185,7 @@
 		</select>
 	<!--条件查询-->
 	<select id="query" resultMap="resultMap">
-		select * from cms_content
+		select ct.* from cms_content ct join cms_category cc on ct.content_category_id=cc.id
 		<where>
 			<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>
@@ -201,12 +201,12 @@
 			<if test="contentDetails != null and contentDetails != ''"> and content_details=#{contentDetails}</if>
 			<if test="contentUrl != null and contentUrl != ''"> and content_url=#{contentUrl}</if>
 			<if test="contentHit != null"> and content_hit=#{contentHit}</if>
-			<if test="appId != null"> and app_id=#{appId} </if>
-			<if test="createBy &gt; 0"> and create_by=#{createBy} </if>
-			<if test="createDate != null"> and create_date=#{createDate} </if>
-			<if test="updateBy &gt; 0"> and update_by=#{updateBy} </if>
+			<if test="appId != null"> and ct.app_id=#{appId} </if>
+			<if test="createBy &gt; 0"> and ct.create_by=#{createBy} </if>
+			<if test="createDate != null"> and ct.create_date=#{createDate} </if>
+			<if test="updateBy &gt; 0"> and ct.update_by=#{updateBy} </if>
 			<if test="updateDate != null"> and update_date=#{updateDate} </if>
-			<if test="del != null"> and del=#{del} </if>
+			<if test="del != null"> and ct.del=#{del} </if>
 			<include refid="net.mingsoft.base.dao.IBaseDao.sqlWhere"></include>
 		</where>
 		order by id desc

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

@@ -213,6 +213,7 @@
                 },
                 contentCategoryIdOptions: [],
                 returnIsShow: true,
+                type:'',
                 //表单数据
                 form: {
                     // 文章标题
@@ -274,7 +275,8 @@
                 this.$refs.form[0].validate((valid) => {
                     if (valid) {
                         that.saveDisabled = true;
-                        if(that.categoryIdOptions.filter(f => f['id'] == that.form.contentCategoryId)[0].categoryType == '2'){
+                        //判断
+                        if(that.categoryIdOptions.filter(f => f['id'] == that.form.contentCategoryId)[0].categoryType == '2' && that.returnIsShow){
                             that.$notify({
                                 title: '提示',
                                 message: '所属栏目不能为封面',
@@ -487,10 +489,11 @@
             this.contentTypeOptionsGet();
             this.form.id = ms.util.getParameter("id");
             this.form.contentCategoryId = ms.util.getParameter("categoryId");
+            this.type = ms.util.getParameter("type");
             if (this.form.id) {
                 this.get(this.form.id);
             }
-            if (this.form.contentCategoryId) {
+            if (this.type) {
                 this.list(this.form.contentCategoryId);
                 this.returnIsShow = false;
             }

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

@@ -37,7 +37,7 @@
 				if(data.categoryType == '1'){
                     this.action = ms.manager +"/cms/content/main.do?categoryId="+data.id;
                 } else if(data.categoryType == '2'){
-                    this.action = ms.manager +"/cms/content/form.do?categoryId="+data.id;
+                    this.action = ms.manager +"/cms/content/form.do?categoryId="+data.id+"&type=2";
                 } else{
                     this.action = ms.manager +"/cms/content/main.do";
                 }

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

@@ -239,7 +239,7 @@
                 if(id){
                     location.href=this.manager+"/cms/content/form.do?id="+id;
                 }else {
-                    location.href=this.manager+"/cms/content/form.do";
+                    location.href=this.manager+"/cms/content/form.do?categoryId="+this.form.contentCategoryId;
                 }
             },
             //表格数据转换