Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
C
cms_sys
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
西魏
cms_sys
Commits
00fce71a
Commit
00fce71a
authored
Dec 22, 2020
by
xierz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
文章列表根据栏目类型进行筛选
parent
493aba32
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
17 additions
and
1 deletion
+17
-1
ContentAction.java
src/main/java/net/mingsoft/cms/action/ContentAction.java
+2
-1
ContentBean.java
src/main/java/net/mingsoft/cms/bean/ContentBean.java
+11
-0
IContentDao.xml
src/main/java/net/mingsoft/cms/dao/IContentDao.xml
+1
-0
main.ftl
src/main/webapp/WEB-INF/manager/cms/content/main.ftl
+3
-0
No files found.
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
?
Object
.
assign
({},
{
categoryType
:
'1'
,
sqlWhere
:
form
.
sqlWhere
},
page
)
:
Object
.
assign
({},
that
.
form
,
page
)).
then
(
function
(
res
)
{
if
(
that
.
loadState
)
{
...
...
Write
Preview
Markdown
is supported
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