文章新增了排序值字段111
This commit is contained in:
parent
397f20c15c
commit
ff24ed4e0c
@ -196,6 +196,10 @@ func (r *ArticleScienceDao) GetArticleSciencePageSearch(req requests.GetArticleS
|
||||
if req.Order.UpdatedAt != "" {
|
||||
query = query.Order("updated_at " + req.Order.UpdatedAt)
|
||||
}
|
||||
|
||||
if req.Order.Sort != "" {
|
||||
query = query.Order("sort " + req.Order.Sort)
|
||||
}
|
||||
}
|
||||
|
||||
// 排序
|
||||
|
||||
@ -15,7 +15,7 @@ type GetArticleSciencePage struct {
|
||||
ArticleTitle string `json:"article_title" form:"article_title" label:"文章标题"` // 文章标题
|
||||
ArticleStatus *int `json:"article_status" form:"article_status" label:"文章状态" validate:"omitempty,numeric,oneof=1 2"` // 文章状态(1:正常 2:禁用)
|
||||
IsTop *int `json:"is_top" form:"is_top" label:"是否置顶" validate:"omitempty,numeric,oneof=0 1"` // 是否置顶(0:否 1:是)
|
||||
Sort int `json:"sort" form:"sort" label:"排序值" validate:"required,numeric,min=1"`
|
||||
|
||||
SourceId string `json:"source_id" form:"source_id" label:"文章来源"` // 文章来源id
|
||||
Order *GetArticleSciencePageOrder `json:"order" form:"order" label:"排序"`
|
||||
}
|
||||
@ -23,6 +23,7 @@ type GetArticleSciencePage struct {
|
||||
// GetArticleSciencePageOrder 获取科普文章列表-分页-排序条件
|
||||
type GetArticleSciencePageOrder struct {
|
||||
UpdatedAt string `json:"updated_at" form:"updated_at" label:"排序"` // 修改时间
|
||||
Sort string `json:"sort" form:"sort" label:"排序值"` // 排序值
|
||||
}
|
||||
|
||||
// PutArticleScience 修改科普文章
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user