mirror of
https://github.com/TeaOSLab/EdgeAPI.git
synced 2025-11-30 21:10:28 +08:00
优化服务列表查询
This commit is contained in:
@@ -784,9 +784,11 @@ func (this *ServerDAO) CountAllEnabledServersMatch(tx *dbs.Tx, groupId int64, ke
|
||||
}
|
||||
if userId > 0 {
|
||||
query.Attr("userId", userId)
|
||||
query.UseIndex("userId")
|
||||
}
|
||||
if clusterId > 0 {
|
||||
query.Attr("clusterId", clusterId)
|
||||
query.UseIndex("clusterId")
|
||||
}
|
||||
if auditingFlag == configutils.BoolStateYes {
|
||||
query.Attr("isAuditing", true)
|
||||
@@ -840,9 +842,11 @@ func (this *ServerDAO) ListEnabledServersMatch(tx *dbs.Tx, offset int64, size in
|
||||
}
|
||||
if userId > 0 {
|
||||
query.Attr("userId", userId)
|
||||
query.UseIndex("userId")
|
||||
}
|
||||
if clusterId > 0 {
|
||||
query.Attr("clusterId", clusterId)
|
||||
query.UseIndex("clusterId")
|
||||
}
|
||||
if auditingFlag == 1 {
|
||||
query.Attr("isAuditing", true)
|
||||
|
||||
Reference in New Issue
Block a user