修正排序

This commit is contained in:
2024-11-10 23:30:09 +08:00
parent ae73a99747
commit c2c14444a9
2 changed files with 2 additions and 2 deletions

View File

@@ -12,7 +12,7 @@ dev:
wait wait
link: link:
ssh -NCPf ai -L 3306:localhost:3306 -L 19530:localhost:19530 -L 4080:localhost:4080 -L 5002:localhost:5002 ssh -NCPf ai -L 3306:localhost:3306 -L 19530:localhost:19530 -L 4080:localhost:4080 -L 5002:localhost:5002 -L 4306:localhost:4306
# 编译项目 # 编译项目
build: build:

View File

@@ -516,7 +516,7 @@ func NewSchema(config Config) (graphql.Schema, error) {
} }
// 如果没有外部排序则使用指定排序 // 如果没有外部排序则使用指定排序
if p.Args["sort"] == nil && p.Args["similar"] == nil && p.Args["sort"] != nil && p.Args["order"] != nil { if p.Args["text"] == nil && p.Args["similar"] == nil {
query = query.Select("web_images.id", goqu.L( query = query.Select("web_images.id", goqu.L(
fmt.Sprintf("ROW_NUMBER() OVER(ORDER BY %s %s)", p.Args["sort"], p.Args["order"]), fmt.Sprintf("ROW_NUMBER() OVER(ORDER BY %s %s)", p.Args["sort"], p.Args["order"]),
).As("row_num")) ).As("row_num"))