game 合并查询

This commit is contained in:
2024-12-06 07:46:00 +08:00
parent 87d5a64691
commit 492e792c27
3 changed files with 50 additions and 37 deletions

View File

@@ -70,11 +70,6 @@ var articleType = graphql.NewObject(graphql.ObjectConfig{
}
return false, nil
}},
"text_count": &graphql.Field{Type: graphql.Int, Description: "文字数量", Resolve: func(p graphql.ResolveParams) (interface{}, error) {
var count int64
err := db.Table("web_images").Where("article_id = ?", p.Source.(Article).ID).Where("text != ''").Count(&count).Error
return int(count), err
}},
},
})