Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
jinli gu
MCMS
Commits
00fce71a
Commit
00fce71a
authored
Dec 22, 2020
by
xierz
Browse files
文章列表根据栏目类型进行筛选
parent
493aba32
Changes
4
Show whitespace changes
Inline
Side-by-side
src/main/java/net/mingsoft/cms/action/ContentAction.java
View file @
00fce71a
...
...
@@ -31,6 +31,7 @@ import net.mingsoft.basic.bean.EUListBean;
import
net.mingsoft.basic.constant.e.BusinessTypeEnum
;
import
net.mingsoft.basic.util.BasicUtil
;
import
net.mingsoft.basic.util.StringUtil
;
import
net.mingsoft.cms.bean.ContentBean
;
import
net.mingsoft.cms.biz.IContentBiz
;
import
net.mingsoft.cms.entity.ContentEntity
;
import
org.apache.shiro.authz.annotation.RequiresPermissions
;
...
...
@@ -108,7 +109,7 @@ public class ContentAction extends BaseAction {
})
@RequestMapping
(
"/list"
)
@ResponseBody
public
ResultData
list
(
@ModelAttribute
@ApiIgnore
Content
Entity
content
,
HttpServletResponse
response
,
HttpServletRequest
request
,
@ApiIgnore
ModelMap
model
,
BindingResult
result
)
{
public
ResultData
list
(
@ModelAttribute
@ApiIgnore
Content
Bean
content
,
HttpServletResponse
response
,
HttpServletRequest
request
,
@ApiIgnore
ModelMap
model
,
BindingResult
result
)
{
BasicUtil
.
startPage
();
List
contentList
=
contentBiz
.
query
(
content
);
return
ResultData
.
build
().
success
(
new
EUListBean
(
contentList
,(
int
)
BasicUtil
.
endPage
(
contentList
).
getTotal
()));
...
...
src/main/java/net/mingsoft/cms/bean/ContentBean.java
View file @
00fce71a
...
...
@@ -57,7 +57,18 @@ public class ContentBean extends ContentEntity {
*/
private
String
noflag
;
/**
* 栏目类型,用于筛选文章列表
*/
private
String
categoryType
;
public
String
getCategoryType
()
{
return
categoryType
;
}
public
void
setCategoryType
(
String
categoryType
)
{
this
.
categoryType
=
categoryType
;
}
public
String
getBeginTime
()
{
return
beginTime
;
...
...
src/main/java/net/mingsoft/cms/dao/IContentDao.xml
View file @
00fce71a
...
...
@@ -219,6 +219,7 @@
<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=
"contentDisplay != null and contentDisplay != ''"
>
and content_display=#{contentDisplay}
</if>
<if
test=
"contentAuthor != null and contentAuthor != ''"
>
and content_author=#{contentAuthor}
</if>
...
...
src/main/webapp/WEB-INF/manager/cms/content/main.ftl
View file @
00fce71a
...
...
@@ -297,7 +297,10 @@
form
:
form
,
page
:
page
},
""
)
;
//筛选栏目类型,
1
=列表
that
.form.categoryType
=
'
1
';
ms
.http.post
(
ms
.manager
+
"/cms/content/list.do"
,
form
.sqlWhere
?
O
bject
.assign
({},
{
categoryType
:
'
1
'
,
sqlWhere
:
form
.sqlWhere
},
page
)
:
O
bject
.assign
({},
that
.form
,
page
))
.then
(
function
(
res
)
{
if
(
that
.loadState
)
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment