Skip to content

Commit

Permalink
fix(reading): 修改列表排序
Browse files Browse the repository at this point in the history
  • Loading branch information
oldme-git committed Jul 15, 2024
1 parent ddf423b commit 5d2188b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion api/other/app/other.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ type (
Id uint `json:"id"`
Name string `json:"name" sm:"书名"`
Author string `json:"author" sm:"作者"`
Status uint `json:"status" sm:"状态 1-完结 2-在读 3-弃读"`
Status uint `json:"status" sm:"状态 1弃读 2完结 9在读"`
FinishedAt string `json:"finished_at" sm:"完结时间"`
}
)
5 changes: 4 additions & 1 deletion internal/logic/reading/reading.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@ import (

// List 读取列表
func List(ctx context.Context) (list []entity.Reading, err error) {
res, err := dao.Reading.Ctx(ctx).All()
res, err := dao.Reading.Ctx(ctx).
Order("status desc").
Order("finished_at desc").
All()
if err != nil {
return nil, utility.Err.Sys(err)
}
Expand Down

0 comments on commit 5d2188b

Please sign in to comment.