【增加发布排序字段】

This commit is contained in:
weizhihong 2023-12-01 15:09:40 +08:00
parent f2c13335c2
commit 6e3f0f64f7

View File

@ -23,7 +23,7 @@ func PageQueryPublished(req *dto.PagePublishedReqDto) *dto.PageDto {
).
LeftJoin(pv, p.DataID.EqCol(pv.ID)).
LeftJoin(u, pv.UserID.EqCol(u.ID)).
Order(pv.PublishAt.Desc())
Order(p.Status.Desc(), pv.PublishAt.Desc())
if req.Name != "" {
where = where.Where(p.Code.Like(fmt.Sprintf("%%%s%%", req.Name)))
}