Browse Source

优化搜索

mingsoft 4 years ago
parent
commit
d5ec6b8350

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

@@ -219,8 +219,13 @@
 			<if test="contentTitle != null and contentTitle != ''"> and  content_title like CONCAT(CONCAT('%',#{contentTitle}),'%')</if>
 			<if test="categoryId != null and categoryId != ''"> 	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="categoryType != null and categoryType != ''">and cc.category_type=#{categoryType}</if>
-			<if test="contentType != null and contentType != ''"> and content_type LIKE CONCAT(CONCAT('%',#{contentType}),'%')</if>
+			<if test="contentType != null and contentType != ''">
+				and
+				<foreach item="item" index="index" collection="contentType.split(',')" open="(" separator="or"
+						 close=")">
+					FIND_IN_SET('${item}',ct.content_type)>0
+				</foreach>
+			</if>
 			<if test="contentDisplay != null and contentDisplay != ''"> and content_display=#{contentDisplay}</if>
 			<if test="contentAuthor != null and contentAuthor != ''"> and content_author=#{contentAuthor}</if>
 			<if test="contentSource != null and contentSource != ''"> and content_source=#{contentSource}</if>

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

@@ -221,7 +221,7 @@
                         <i class="el-icon-plus"></i>
                         <div slot="tip" class="ms-form-tip">
                             只能上传1张图片
-                            标签:<a href="http://doc.mingsoft.net/mcms/biao-qian/lan-mu-lie-biao-ms-channel.html" target="_blank">${'$'}<#noparse >{@ms:file field.typelitpic/}</#noparse></a><br/>
+                            标签:<a href="http://doc.mingsoft.net/mcms/biao-qian/lan-mu-lie-biao-ms-channel.html" target="_blank"><#noparse>{@ms:file field.typelitpic/}</#noparse></a><br/>
                         </div>
                     </el-upload>
                 </el-form-item>

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

@@ -271,6 +271,7 @@
 					}).then(function (res) {
 						if (res.result) {
 							that.$notify({
+								title: '成功 ',
 								type: 'success',
 								message: '删除成功!'
 							}); //删除成功,刷新列表

+ 3 - 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="categoryFlag">
-                            <el-select v-model="form.categoryFlag"
+                        <el-form-item  label="文章类型" prop="contentType">
+                            <el-select v-model="form.contentType"
                                        :style="{width: '100%'}"
                                        :filterable="false"
                                        :disabled="false"
@@ -349,6 +349,7 @@
                     }).then(function (res) {
                         if (res.result) {
                             that.$notify({
+                                title:'成功',
                                 type: 'success',
                                 message: '删除成功!'
                             }); //删除成功,刷新列表