Skip to content

Commit

Permalink
🐛 edit the post detail next bug
Browse files Browse the repository at this point in the history
  • Loading branch information
xzghua committed Jul 4, 2019
1 parent df8937d commit 951897f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
12 changes: 11 additions & 1 deletion service/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,5 +50,15 @@ func UserStore(ar common.AuthRegister) (user *entity.ZUsers, err error) {
}

func DelAllCache() {
conf.CacheClient.Del( conf.Cnf.CateListKey, conf.Cnf.TagListKey, conf.Cnf.PostIndexKey, conf.Cnf.TagPostIndexKey, conf.Cnf.CatePostIndexKey, conf.Cnf.LinkIndexKey, conf.Cnf.SystemIndexKey, conf.Cnf.PostDetailIndexKey,conf.Cnf.ArchivesKey)
conf.CacheClient.Del(
conf.Cnf.TagListKey,
conf.Cnf.CateListKey,
conf.Cnf.ArchivesKey,
conf.Cnf.LinkIndexKey,
conf.Cnf.PostIndexKey,
conf.Cnf.SystemIndexKey,
conf.Cnf.TagPostIndexKey,
conf.Cnf.CatePostIndexKey,
conf.Cnf.PostDetailIndexKey,
)
}
2 changes: 1 addition & 1 deletion service/post.go
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ func LastPost(postId int) (post *entity.ZPosts,err error) {

func NextPost(postId int) (post *entity.ZPosts,err error) {
post = new(entity.ZPosts)
_,err = conf.SqlServer.Where("id > ?",postId).Where("deleted_at IS NULL OR deleted_at = ?","0001-01-01 00:00:00").Desc("id").Get(post)
_,err = conf.SqlServer.Where("id > ?",postId).Where("deleted_at IS NULL OR deleted_at = ?","0001-01-01 00:00:00").Asc("id").Get(post)
return
}

Expand Down

0 comments on commit 951897f

Please sign in to comment.