Skip to content

Commit

Permalink
🐛 fixed otale#379
Browse files Browse the repository at this point in the history
  • Loading branch information
hellokaton committed Apr 21, 2018
1 parent 065ffcf commit ebab9e9
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<sqlite.version>3.21.0.1</sqlite.version>
<blade-mvc.version>2.0.8-ALPHA2</blade-mvc.version>
<anima.version>0.2.0</anima.version>
<anima.version>0.2.1-SNAPSHOT</anima.version>
<blade-tpl.verion>0.1.3</blade-tpl.verion>
<blade-validator>0.0.2</blade-validator>
<commonmark.version>0.11.0</commonmark.version>
Expand Down
1 change: 1 addition & 0 deletions src/main/java/com/tale/controller/CategoryController.java
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ public String categories(Request request, @PathParam String keyword, @Param(defa
@GetRoute(value = {"category/:keyword/:page", "category/:keyword/:page.html"})
public String categories(Request request, @PathParam String keyword,
@PathParam int page, @Param(defaultValue = "12") int limit) {

page = page < 0 || page > TaleConst.MAX_PAGE ? 1 : page;
Metas metaDto = metasService.getMeta(Types.CATEGORY, keyword);
if (null == metaDto) {
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/com/tale/service/ContentsService.java
Original file line number Diff line number Diff line change
Expand Up @@ -158,8 +158,8 @@ public void delete(int cid) {
*/
public Page<Contents> getArticles(Integer mid, int page, int limit) {
String sql = "select a.* from t_contents a left join t_relationships b on a.cid = b.cid " +
"where b.mid = "+mid+" and a.status = 'publish' and a.type = 'post' order by a.created desc";
"where b.mid = " + mid + " and a.status = 'publish' and a.type = 'post' order by a.created desc";

return select().bySQL(Contents.class, sql).page(page, limit);
}

Expand Down

0 comments on commit ebab9e9

Please sign in to comment.