Skip to content

Commit

Permalink
fix(region): distinct fields (#20356)
Browse files Browse the repository at this point in the history
  • Loading branch information
ioito committed May 24, 2024
1 parent a216a37 commit 803584d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions pkg/cloudcommon/db/modelbase.go
Original file line number Diff line number Diff line change
Expand Up @@ -513,7 +513,7 @@ func (manager *SModelBaseManager) GetPropertyDistinctFields(ctx context.Context,
result := jsonutils.NewDict()
fields := jsonutils.NewArray()
if len(input.Field) > 0 {
sq := q.Copy()
sq := q.Copy().ResetFields()
// query field
for i := 0; i < len(input.Field); i++ {
sq = sq.AppendField(sq.Field(input.Field[i]))
Expand All @@ -536,7 +536,7 @@ func (manager *SModelBaseManager) GetPropertyDistinctFields(ctx context.Context,
extraFields := jsonutils.NewArray()
if len(input.ExtraResource) > 0 && len(input.ExtraField) > 0 {
// query extra field
sq := q.Copy()
sq := q.Copy().ResetFields()
em := GetModelManager(input.ExtraResource)
if gotypes.IsNil(em) {
return nil, httperrors.NewInputParameterError("invalid extra_resource %s", input.ExtraResource)
Expand Down
3 changes: 2 additions & 1 deletion vendor/yunion.io/x/sqlchemy/query.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 803584d

Please sign in to comment.